Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error:OAuth2 request failed: Service responded with error: 'bad client id: APP_ID_OR_ORIGIN_NOT_MATCH'

I am trying to create this example:

https://github.com/GoogleDeveloperExperts/chrome-extension-google-apis .

And I am having problems with my client id. I have already added to my client id the Gmail API service. Also when I use the example's client id everything is ok but when I use my client id I get this error:

OAuth2 request failed: Service responded with error: 'bad client id: APP_ID_OR_ORIGIN_NOT_MATCH'.

Have someone an idea what is wrong?

like image 747
user2142558 Avatar asked Apr 10 '18 22:04

user2142558


2 Answers

Two possibilities that I've faced:

  1. The client ID type you created wasn't for "Chrome App"
  2. In the Credentials section of the developers console, click on the name of your client ID, and make sure that the "Applicaiton ID" section is correctly filled out. This should contain the ID shown under chrome://extensions/ as a a 32 character ID just below the description of your extension.
like image 186
Ron Greer Avatar answered Sep 30 '22 16:09

Ron Greer


In my case, I forgot to include scopes in the manifest file in the oauth2 section.

"scopes": [
     "openid", "email", "profile"
]

If it ever helps anyone...

like image 36
Armand Avatar answered Sep 30 '22 17:09

Armand