N8n gmail agent tool access block issue

Hi, I am trying to practice lab1 of n8n course. When trying to configure OAuth2 for “gmail tool”. it always fails with the below access denied issue. Exactly same steps as mentioned in the lab instructions were followed however the same issue persists. Tried this 5times in different days but same result. Need you assistance

I find the lab confusing, but did not see this particular problem TBH. I assume you have a google account and was able to create the credential in the google console; this does not happen inside of the lab exactly.

Hi @debu3645

I believe you haven’t set up Google OAuth2 yet. Please check the documentation and ensure that the Authorized redirect URIs are configured correctly in the Google Console.

Thanks for the response @rob_kodekloud
I realized that my email Id should have been added as “test user”. After adding it as test user, this issue gets resolved however I came across another issue. The control goes to the next step “Google hasn’t verified this app”. If I select continue, then select All (or some of them) and select continue, it throws this error: {“status”:“error”,“message”:“Unauthorized”}

Thanks for the response @raymond.baoly
I have setup OAuth2, and only then the ‘google signin’ option appears in n8n browser.

I realized that my email Id should have been added as “test user”. After adding it as test user, this issue gets resolved.

However I came across another issue. The control goes to the next step “Google hasn’t verified this app”. If I select continue, then select All (or some of them) and select continue, it throws this error: {“status”:“error”,“message”:“Unauthorized”}

Any suggestions, appreciated.

Hi @debu3645

Please refer to the solution here The n8n.cloud app did not complete the Google verification process - Questions - n8n Community

Hi @raymond.baoly

Thanks for the support.
The issue is in the kodekloud redirect URI. It creates a redirect link like below:
Now, if I execute this link in the browser, I get the same error.

OAuth2 redirect: https://8080-port-abfebwvd45xejq55.labs.kodekloud.com/rest/oauth2-credential/callback

Similar discussion being discussed here in the n8n community, pointing the issue at the lab/environment: OAuth Integration Issue with Google APIs in n8n on Google Cloud Run - "Unauthorized" Error - #2 by tamy.santos - Questions - n8n Community

Let me check and get back @debu3645

Yes, the OAuth redirect URL returns an unauthorized error. I will forward this to the team to check and fix it.