Search code examples
google-chromegmail-api

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?


Solution

  • 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.