简体   繁体   中英

"Error 403: access_denied" when usign Google OAuth

I am trying to understand the basic logics for receiving GMail emails with Google OAuth. I see this document Authorizing Your App with Gmail

Now I follow the instructions in Setting Up POP3 Importing with OAuth via Google to setup POP3 with Google OAuth.

I login one Google account(Account1) and then in Google Cloud, create the Google App and OAuth Client ID.

Then I start connect to GMail account(Account2) with the web application(WHMCS). When connecting, it asks me to choose an account that create the app, so I choose Account1. But get the following error:

Error 403: access_denied The developer hasn't given you access to this app.

Thus I am a bit confused. Since Account1 is used to create the app and OAuth Client ID, it should be able to access the app when I choose Account1, but the app will not be able to access the data in Account2. Or does the App in the error message means Gmail , not the app I created in Google Cloud?

Should I use Account2 to create the app for receiving emails in Account2? If yes, then for each Gmail account, should I create a separate app accordingly?

The project you create on google cloud console is still in the testing phase. Each user you want to allow to test your application must be added as a test user. Other wise only the owner of the project can test the applicaiton.

To fix this issue for me was this simple:

  1. Go to https://console.developers.google.com/
  2. open the project in question.
  3. Click "OAuth consent screen" on the left.
  4. Under "Test users" there is a button called "+ ADD USERS"
  5. Type the email of the account you will be testing with, press enter, then click save.
  6. It should work now

It seems like they updated this recently because last year I did not have to do this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM