I am trying to get an auth token using:
chrome.identity.getAuthToken({ interactive: false }, function (token) {
console.log('token', token);
});
token is undefined and I receive the error:
Unchecked runtime.lastError: OAuth2 request failed: Service responded with error: 'bad client id
my manifest json's oauth2 looks like this:
"version": "1.0",
"manifest_version": 3,
"background": {
"service_worker": "background.js"
},
"oauth2": {
"client_id": "<my_client_id>.apps.googleusercontent.com",
"scopes": [
"profile email",
"https://www.googleapis.com/auth/userinfo.email",
"https://www.googleapis.com/auth/drive.file"
]
},
I added my client id following the instructions here:
https://developer.chrome.com/docs/extensions/mv3/tut_oauth/#oauth_client
I notice that the instructions say:
On the Create client ID page, select Chrome App
However, chrome apps are being deprecated. So I have two questions, why is my client id bad, and is there a way to auth a user without using a chrome app, as chrome apps are being deprecated.