Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InternalOAuthError: failed to fetch user profile #24

Open
AaronNGray opened this issue Apr 5, 2017 · 20 comments
Open

InternalOAuthError: failed to fetch user profile #24

AaronNGray opened this issue Apr 5, 2017 · 20 comments

Comments

@AaronNGray
Copy link

Using both https://github.com/mjhea0/passport-examples and https://github.com/barberboy/passport-google-oauth2-example I am getting the following error :-

InternalOAuthError: failed to fetch user profile
at C:\Users\aaron\Tests\JavaScript\Facebook\passport-examples\node_modules\passport-google-oauth2\lib\oauth2.js:92:28
at passBackControl (C:\Users\aaron\Tests\JavaScript\Facebook\passport-examples\node_modules\oauth\lib\oauth2.js:132:9)
at IncomingMessage. (C:\Users\aaron\Tests\JavaScript\Facebook\passport-examples\node_modules\oauth\lib\oauth2.js:157:7)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)

@edahlseng
Copy link

Did you set the "profile" scope in the strategy options? If you don't want the full user profile, you can alternatively set options.skipUserProfile to true to prevent this error.

@hiepnm
Copy link

hiepnm commented Aug 3, 2018

+1 the same error. I enabled Google+ API too.

@hiepnm
Copy link

hiepnm commented Aug 14, 2018

I got:

InternalOAuthError: failed to fetch user profile
at /home/longnv/workspace/sm1/node_modules/passport-google-oauth2/lib/oauth2.js:92:28
at passBackControl (/home/longnv/workspace/sm1/node_modules/oauth/lib/oauth2.js:132:9)
at IncomingMessage. (/home/longnv/workspace/sm1/node_modules/oauth/lib/oauth2.js:157:7)
at IncomingMessage.emit (events.js:185:15)
at endReadableNT (_stream_readable.js:1101:12)
at process._tickCallback (internal/process/next_tick.js:114:19)

@mergoc
Copy link

mergoc commented Oct 26, 2019

did anyone ever figure out how to fix this?

@teebu
Copy link

teebu commented Dec 6, 2019

using these scopes fixed my error:

scope: ['https://www.googleapis.com/auth/plus.login',
            'https://www.googleapis.com/auth/userinfo.email']

@benjaminv
Copy link

using these scopes fixed my error:

scope: ['https://www.googleapis.com/auth/plus.login',
            'https://www.googleapis.com/auth/userinfo.email']

I am new to this, where to implement this please?

@Ashik155
Copy link

Ashik155 commented May 7, 2022

I have the same things going on

@zulfikar4568
Copy link

I have same issue
image

@sorasful
Copy link

sorasful commented Dec 8, 2022

Hi @zulfikar4568 , by any chance did you manage to find a solution for this problem ?

@sorasful
Copy link

It seems that updating node version fixed the issue.

@TheCreaToR-01
Copy link

using this userProfileURL: "https://www.googleapis.com/oauth2/v3/userinfo" solved my problem as google plus api is now deprecated

@vishakhasingh4
Copy link

It seems that updating node version fixed the issue.

Hey, could you please explain exactly to which version we have to update? I am seeing the same error.

@vishakhasingh4
Copy link

Hey, did anyone find the solution to this problem? Above things not working for me. I am using passport-google-oauth20 - version 2

@chunkydonut21
Copy link

It seems that updating node version fixed the issue.

Thanks, man! It worked.

@AshisheKumar
Copy link

If anyone got the answer of the problem, please help...

@AaronNGray
Copy link
Author

AaronNGray commented Aug 9, 2023 via email

@minhhn2910
Copy link

I also faced this problem today. For my case: cleaned node_modules, install node 18.17 LTS and reinstall all packages solved it.

@AshisheKumar
Copy link

AshisheKumar commented Aug 10, 2023 via email

@mukeshsinghmanral
Copy link

mukeshsinghmanral commented Sep 27, 2024

add "openid" in scope, it will work

passport.use(new LinkedinStrategy({
clientID: process.env.LINKEDIN_CLIENT_ID,
clientSecret: process.env.LINKEDIN_CLIENT_SECRET,
callbackURL: "http://localhost:3000/auth/linkedin/callback",
scope: ['email','profile','openid'],

},

@AshisheKumar
Copy link

add "openid" in scope, it will work

passport.use(new LinkedinStrategy({ clientID: process.env.LINKEDIN_CLIENT_ID, clientSecret: process.env.LINKEDIN_CLIENT_SECRET, callbackURL: "http://localhost:3000/auth/linkedin/callback", scope: ['email','profile','openid'],

},

Thanks, it Worked...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests