-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Sign In with LinkedIn
is deprecated, use Sign In with LinkedIn using OpenID Connect
instead
#8316
Comments
Just to add more information,
Currently, the scopes have these names: But previously, they had these names: The Auth0 team has a quite similar issue. |
Hi, Getting same
After adding Does anybody have suggestions? More info:
|
Hey, guys, had the same issue, I was able to fix this locally - I'll link a PR soon. @yanachepyk user info is not retrieved cause the way next-auth handles profile response for linked-in is outdated. |
Hi @setren, you just to add more information LinkedInProvider({
clientId: process.env.LINKEDIN_CLIENT_ID,
clientSecret: process.env.LINKEDIN_CLIENT_SECRET,
authorization: {
params: { scope: 'openid profile email' },
},
issuer: 'https://www.linkedin.com',
jwks_endpoint: 'https://www.linkedin.com/oauth/openid/jwks',
profile(profile, tokens) {
const defaultImage =
'https://cdn-icons-png.flaticon.com/512/174/174857.png';
return {
id: profile.sub,
name: profile.name,
email: profile.email,
image: profile.picture ?? defaultImage,
};
},
}) Currently, the scopes have these names: |
That works, cool 🙌 |
@tranminhwang I am able to return the access_token from this? adding
|
@joemulberry No, you have to add a JWT callback jwt({ token, account }) {
if (account) {
token.access_token = account.access_token;
}
return token;
}, read more here: https://next-auth.js.org/configuration/callbacks |
Thanks |
Correct me at any point if i am wrong, Login with LinkedIn might not be use full (for getting users' details), this might as well be the same as logging in with google because these details are not impactful considering LinkedIn keeps so much more which it exposed in their previous API which is now deprecated. |
Unfortunately, this is still an issue that several people run into (including me). See #8831 What's the issue?
Any info when this will be fixed is highly appreciated (I could actually help). I would also suggest to reopen this issue until it is fixed. |
@goerlitz I agree the issue is still there I feel these scopes are deprecated |
2024-01-09T12:39:45.140+05:30�[0;39m �[31mERROR�[0;39m �[35m34948�[0;39m �[2m---�[0;39m �[2m[nio-8080-exec-5]�[0;39m �[2m�[0;39m�[36mc.t.S.I.p.securities.WebSecurityConfig �[0;39m �[2m:�[0;39m Authentication failure: [invalid_nonce] |
Issue is still there with latest version and default configuration. |
1 similar comment
Issue is still there with latest version and default configuration. |
i am getting this error. other than this i am getting user info and accesstokens everything successfully. whenever i check status from useSession i am getting
|
Sadly, this approach no longer works. Still getting an error.
|
I'm getting this error also. Did you find a solution? |
do you guys still need help? i have successfully integrated LinkedIn login in next auth |
It’s actually oidc not openid. That’s a scope |
well whatever it is. i fixed it back then and it's in production now servicing as a country's best recruit management service. |
Provider type
LinkedIn
Environment
System:
OS: macOS 13.4.1
CPU: (8) arm64 Apple M1
Memory: 82.78 MB / 8.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 16.17.0 - ~/.nvm/versions/node/v16.17.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v16.17.0/bin/yarn
npm: 9.6.5 - ~/.nvm/versions/node/v16.17.0/bin/npm
pnpm: 7.5.2 - ~/.nvm/versions/node/v16.17.0/bin/pnpm
Browsers:
Chrome: 115.0.5790.170
Safari: 16.5.2
Reproduction URL
https://github.com/setren/linkedin-provider
Describe the issue
Linkedin changed its authentication method from
Sign in with LinkedIn
toSign in with LinkedIn using OpenID Connect
, since then the new app registered recently had this errorIt seems that scope variable changed from
"r_liteprofile r_emailaddress"
to"profile email"
https://learn.microsoft.com/en-us/linkedin/shared/authentication/getting-access#open-permissions-consumer. I have tried to add scope manuallyLinkedinProvider({ clientId: process.env.LINKEDIN_CLIENT_ID!, clientSecret: process.env.LINKEDIN_CLIENT_SECRET!, authorization: { params: { scope: "profile email", }, }, }),
but it gives this errorSimilar problem using firebase https://stackoverflow.com/questions/76890650/sign-in-with-linkedin-using-openid-connect-with-firebase-auth-or-gcp-identity-pl
How to reproduce
-Clone this repo https://github.com/nextauthjs/next-auth-example
-Add linkedin provider
Expected behavior
The user is available to sign in.
The text was updated successfully, but these errors were encountered: