passport-google-oauth2
passport-google-oauth2 copied to clipboard
InternalOAuthError
WHEN I TRYING TO LOGIN WITH GOOGLE OAUTH2 I SEE THIS ERROR
InternalOAuthError: Failed to obtain access token
at Strategy.OAuth2Strategy._createOAuthError (/Users/kprat1/learning/passportexamples2/passport-examples/node_modules/passport-oauth2/lib/strategy.js:370:17)
at /Users/kprat1/learning/passportexamples2/passport-examples/node_modules/passport-oauth2/lib/strategy.js:166:45
at /Users/kprat1/learning/passportexamples2/passport-examples/node_modules/oauth/lib/oauth2.js:177:18
at ClientRequest.
i got the same issue, how did you fix it?
I got the exactly same issue, so could you teach me how to fix it please? @Kamaraju333 @senseluo
Same issue happening again...
Seems i did nothing but push it to production environment and everything works well again. but in my local machine, this issue happening again and again.
@senseluo That happens on my side as well.
I had the same problem with getting the user profile. It seems that the userinfo URL has changed as Google shuts down google+
The default userinfo URL in passport-google-oauth2 is https://www.googleapis.com/plus/v1/people/me
But the official userinfo URL seems to be: https://www.googleapis.com/oauth2/v3/userinfo
You can read more about Google OpenID Connect at https://developers.google.com/identity/protocols/OpenIDConnect#discovery
If you run your application in a Docker container, make sure that your Docker default bridge is reconfigured as the default config is 172.x.x.x and in my case it conflicted with a google ip address 172.217.23.74
I have the same issue, Who could help me?
I have the same issue, Who could help me?
Have you tried use a global proxy? Only in case you are unfortunately located in China like me...
I have the same issue, Who could help me?
Have you tried use a global proxy? Only in case you are unfortunately located in China like me...
I have this issue as well, and I am in China, how to fix this then? Is it something to do with proxy or vpn? thank you
I have the same issue when I run this inside docker container with Nginx reverse proxy configured.
authentication-ms | [Nest] 18 - 01/18/2021, 1:33:58 PM [ExceptionsHandler] Failed to obtain access token +11011ms
authentication-ms | InternalOAuthError: Failed to obtain access token
authentication-ms | at GoogleStrategy.OAuth2Strategy._createOAuthError (/usr/src/app/node_modules/passport-oauth2/lib/strategy.js:408:17)
authentication-ms | at /usr/src/app/node_modules/passport-oauth2/lib/strategy.js:175:45
authentication-ms | at /usr/src/app/node_modules/oauth/lib/oauth2.js:191:18
authentication-ms | at ClientRequest.<anonymous> (/usr/src/app/node_modules/oauth/lib/oauth2.js:162:5)
authentication-ms | at ClientRequest.emit (events.js:210:5)
authentication-ms | at TLSSocket.socketErrorListener (_http_client.js:406:9)
authentication-ms | at TLSSocket.emit (events.js:210:5)
authentication-ms | at emitErrorNT (internal/streams/destroy.js:92:8)
authentication-ms | at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
authentication-ms | at processTicksAndRejections (internal/process/task_queues.js:80:21