providers/descope
default()β
default(
config
):OIDCConfig
<DescopeProfile
>
Setupβ
Callback URLβ
https://example.com/api/auth/callback/descope
Configurationβ
Import the provider and configure it in your Auth.js initialization file:
import NextAuth from "next-auth"
import DescopeProvider from "next-auth/providers/descope";
export default NextAuth({
providers: [
DescopeProvider({
clientId: process.env.DESCOPE_ID,
clientSecret: process.env.DESCOPE_SECRET,
}),
],
})
Configuring Descopeβ
Follow these steps:
- Log into the Descope console
- Follow the OIDC instructions
Then, create a .env.local
file in the project root add the following entries:
Get the following from the Descope's console:
DESCOPE_ID="<Descope Issuer's last url segment>" # Descope's Issuer can be found in "Authentication Methods > SSO > Identity Provider" (Can also be taken from "Project > Project ID")
DESCOPE_SECRET="<Descope Access Key>" # Manage > Access Keys
Resourcesβ
Notesβ
The Descope provider comes with a default configuration. To override the defaults for your use case, check out customizing a built-in OAuth provider.
By default, Auth.js assumes that the Descope provider is based on the OIDC spec
Helpβ
If you think you found a bug in the default configuration, you can open an issue.
Auth.js strictly adheres to the specification and it cannot take responsibility for any deviation from the spec by the provider. You can open an issue, but if the problem is non-compliance with the spec, we might not pursue a resolution. You can ask for more help in Discussions.
Parametersβ
βͺ config: OIDCUserConfig
< DescopeProfile
>
Returnsβ
DescopeProfileβ
The returned user profile from Descope when using the profile callback. See Load User
Indexableβ
[claim
: string
]: unknown
Propertiesβ
emailβ
email:
string
The user's email
email_verifiedβ
email_verified:
boolean
A boolean indicating if the user's email is verified
nameβ
name:
string
The user's name
phone_numberβ
phone_number:
string
The user's phone number
phone_number_verifiedβ
phone_number_verified:
boolean
A boolean indicating if the user's phone number is verified
pictureβ
picture:
string
The user's picture
subβ
sub:
string
The user's unique Descope ID