I thought I had things rolling but I've discovered I have this error after calling getAuthToken with interactive:false :
OAuth2 request failed: Service responded with error: 'Bad Request'
'Bad Request' really tells me very little. Ok, I understand I'll probably need to use interative:true (why?) and so when I attempt that, it spawns my browser, prompts my google login (which I enter and which is a real pain because we have 2-step authentication), then does... nothing... the callback is never called...
Anyone interested in helping me out will probably want to see bits from my manifest.json:
"key": "MII...QAB",
"oauth2": {
"client_id": "35...-lnf...1pd.apps.googleusercontent.com",
"scopes": [ "identity" ]
},
"permissions":[ "identity", "https://accounts.google.com/*", "https://www.googleapis.com/*", "https://*.amazonaws.com/*", "<all_urls>" ],
You'll also probably want to see the code in question:
chrome.identity.getAuthToken({ 'interactive': true, 'scopes':['identity'] }, function ( token ) {
if ( chrome.runtime.lastError ) {
next(chrome.runtime.lastError);
} else {
next( null, token );
}
});
or, alternatively:
chrome.identity.getAuthToken({ 'interactive': false }, function ( token ) {
if ( chrome.runtime.lastError ) {
next(chrome.runtime.lastError);
} else {
next( null, token );
}
});
I am happy to provide any other information that might be helpful in identifying where I'm going wrong.