Skip to content

Commit

Permalink
Send client_id and client_secret to linkedin
Browse files Browse the repository at this point in the history
Linkedin now requires client_id and client_secret to be
sent in the oauth callback. Fixes #5220
  • Loading branch information
sildur committed Aug 27, 2022
1 parent c57a810 commit b6d332e
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion packages/next-auth/src/providers/linkedin.ts
Expand Up @@ -30,7 +30,25 @@ export default function LinkedIn<P extends LinkedInProfile>(
url: "https://www.linkedin.com/oauth/v2/authorization",
params: { scope: "r_liteprofile r_emailaddress" },
},
token: "https://www.linkedin.com/oauth/v2/accessToken",
token: {
url: "https://www.linkedin.com/oauth/v2/accessToken",
async request({
client,
params,
checks,
provider
}) {
const response = await client.oauthCallback(provider.callbackUrl, params, checks, {
exchangeBody: {
client_id: options.clientId,
client_secret: options.clientSecret,
}
});
return {
tokens: response
};
}
},
userinfo: {
url: "https://api.linkedin.com/v2/me",
params: {
Expand Down

0 comments on commit b6d332e

Please sign in to comment.