Last active
January 3, 2024 01:49
-
-
Save MatteoGauthier/56c34565c2bf24d18abb8d517e402eed to your computer and use it in GitHub Desktop.
Kinde OAuth as a next-auth provider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const authOptions = { | |
// ... | |
providers: [ | |
{ | |
id: "kinde", | |
name: "Kinde", | |
type: "oauth", | |
wellKnown: `https://TENANT_ID.kinde.com/.well-known/openid-configuration`, | |
idToken: true, | |
authorization: { | |
params: { | |
scope: "openid email profile", | |
}, | |
}, | |
checks: ["state", "pkce"], | |
options: { | |
clientId: "CLIENT_ID", | |
clientSecret: "CLIENT_SECRET", | |
}, | |
profile(profile) { | |
return { | |
id: profile.sub, | |
name: profile.name || profile.email, | |
email: profile.email, | |
} as User | |
}, | |
}, | |
] | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment