I have this call (I removed error-handling for brevity's sake):
chrome.identity.getAuthToken({interactive: true}, function (token) {
let req = new XMLHttpRequest();
req.open('GET', 'https://www.googleapis.com/oauth2/v1/userinfo?alt=json&access_token=' + token);
req.onload = function() {
console.log('this userinfo => ', req.response);
};
req.send();
});
I get this logged:
this userinfo => {
"error": {
"errors": [
{
"domain": "global",
"reason": "insufficientPermissions",
"message": "Insufficient Permission"
}
],
"code": 403,
"message": "Insufficient Permission"
}
}
I believe that I need to add the following to my manifest.json file...
before I have this:
"oauth2": {
"client_id": "5461307462-7gebv03xxx9csfidfg5f6ggxxxrju9374.apps.googleusercontent.com",
"scopes": [
"https://www.googleapis.com/auth/chromewebstore.readonly"
]
},
then I add this:
"oauth2": {
"client_id": "5461307462-7gebv03xxx9csfidfg5f6ggxxxrju9374.apps.googleusercontent.com",
"scopes": [
"https://www.googleapis.com/oauth2/v1/userinfo",
"https://www.googleapis.com/oauth2/v1/userinfo.picture",
"https://www.googleapis.com/auth/chromewebstore.readonly"
]
},
the problem though, is that the authentication method then changes. I no longer get this view:
instead I get a new Chrome tab that looks like this:
the problem is, no matter how many times I login, it always bounces back to the same login tab. Furthermore, I cannot access any other Chrome tab, it keeps bouncing me back to the same Chrome auth tab. It's so weird and such an awful experience.
Does anyone know what might be going on?