DEV Community

Discussion on: How to Implement Login with Google in Nest JS

Collapse
 
zicjin profile image
zicjin • Edited

InternalOAuthError: Failed to obtain access token
at GoogleStrategy.OAuth2Strategy._createOAuthError (C:\Work_test\google-oauth-nestjs\node_modules\passport-oauth2\lib\strategy.js:408:17)

i just test github.com/iMichaelOwolabi/google-...

I got the correct google account login interface and logged in successfully, but reported an error when calling back the localhost:3000/google/redirect?cod....

How can I tell if I have a problem with my google project settings or JS code?

Collapse
 
imichaelowolabi profile image
Michael Owolabi

Hi Zicjin, try to reconfirm your redirect URL both on google and in your code as well as the scope. Sometimes when asking for non-existent scope, you may get such error.
Please let me know how it goes.

Collapse
 
smasala profile image
Steven Masala

For others: double check your client ID and secret for the typos.