I am working with Chrome Identity API, to provide users with a Google Authentication on my Chrome Extension.
I followed the official tutorial of Google : link Chrome Id
If the callback in chrome.identity.getAuthToken
is not firing at all for you, make sure you are using "browser_action" in your manifest.json and not "page_action".
For other user, who might face the problem that chrome.identify.getauthtoken is not firing or you log in and nothing happens.
Check your manifest and reduce it to the bare minimum. For example the "oauth2": { "client.id": "alongstring" , "scopes": ["bla","openid", "bla"]}. Having openid in the array, the callback simply did not fire, no alert, no nothing.
Having openid inside my scopes inside oauth2 blocked in someway the callback from being fired.
The accepted answer is incorrect. You can upload it to the webstore, publish it, then install it from the webstore. After installing, find the installed extension app dir (~/Library/Application\ Support/Google/Chrome/Default/Extensions/<ext id>
on a mac), and copy the key
key from the installed manifest.json
into your source code manifest.json
. After adding the key
field to your manifest.json
, your app id will not change during local development.
Source: https://developer.chrome.com/apps/app_identity#copy_key
Problem Resolved !
the app ID of my Chrome extension
does not match with my app ID in Google Console Developpers
To avoid this upload first your Extension then copy the ID from Chrome and set it in the Google Console Developpers !
you must update it in Google console everytime you change it in Google Chrome