chrome-extensions-samples icon indicating copy to clipboard operation
chrome-extensions-samples copied to clipboard

chrome.identity.getAuthToken requires re-authorisation from the user, even though the user has already given permission to my app.

Open KiranNadig62 opened this issue 3 years ago • 0 comments

Describe the bug chrome.identity.getAuthToken requires re-authorisation from the user, even though the user has already given permission to my app.

To Reproduce Steps to reproduce the behavior, or file the issue is found in:

  1. Get user authorisation for required scopes using chrome.identity.getAuthToken({ account: { id: googleAccountId }, interactive: true }, (token) => { console.log("Access token", token); }) This brings up a dialog that prompts the user to authorize my app to access certain sensitive scopes. Once the user accepts it, I get the access token and use that to get user information.

  2. Whenever I need an access token I call the chrome.identity.getAuthToken. I understand chrome caches it internally, so I do not need to worry about calling it multiple times.

  3. Every once in a while, it seems that the user will need to re-authorize my app. i.e. calling the chrome.identity.getAuthToken non interactively does not work. The user will need to be prompted again to authorize my app. This is the issue.

Expected behavior Once the user has authorized my application and given permission to certain sensitive scopes unless there is a change in password / there is a need to access new scopes, the chrome.identity API should never ask the user to re-authorize my app. This is an extremely poor user experience.

Notes

  1. When the user was prompted to re-authorize my app again, I checked the permissions for my app for that user under accounts.google.com. My app already had the required permissions.

My understanding is that once a user has given permission to my app - it should never bring up the dialog again (for that user).

(My understanding of the chrome.identity API may be incorrect, if so please let me know).

Any input is much appreciated.

KiranNadig62 avatar Jul 07 '21 08:07 KiranNadig62