Skip to content

Instantly share code, notes, and snippets.

@MatteoGauthier
Last active January 3, 2024 01:49
Show Gist options
  • Save MatteoGauthier/56c34565c2bf24d18abb8d517e402eed to your computer and use it in GitHub Desktop.
Save MatteoGauthier/56c34565c2bf24d18abb8d517e402eed to your computer and use it in GitHub Desktop.
Kinde OAuth as a next-auth provider
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