Error: invalid_client with Google Apps API OAuth2

2020-02-06 04:50发布

问题:

I am using Google Apps API for my application with OAuth2. ,but I get an error.

Error: invalid_client

no support email

Request Details That’s all we know.

回答1:

If you create OAuth credentials BEFORE you set the support email address in the consent screen, then it appears that you will always get this error, even after setting the support email.

I resolved this by setting the support email, and then recreating all necessary OAuth ids in the credentials page.



回答2:

In the Google Developer console make sure that you have added a product name and an email address under. Apps & auths -> consent screen.

Update: This shouldn't be to much of a problem anymore. Google made a change in the console that wont let you save anything until you have updated these items.



回答3:

In Google Developer Console turn Gmail API on.

GDC > Dashboard > Use Google APIs > Google Apps APIs > Gmail API



回答4:

Be sure that you are set up the setDeveloperKey with your EMAIL ADDRESS offred in Google Console whe you create a Client ID for web application.



回答5:

Had the same problem and the solution was:

  • Set my email
  • Recreate the keys
  • Activate Google API+ from API Library


回答6:

1) Fill out the info email address and produce name as well as other details in the 'consent' screen on google's console when you generate the keys.

2) And make sure when you copy paste the ClientID and ClientSecret code from google to your workspace (IDE), there might be some unwanted spaces inbetween

Check with the google console and remove it.

Hope this helps,

--happy coding!