providers/descope
DescopeProfile
The returned user profile from Descope when using the profile callback. See Load User
Indexable
[claim
: string
]: unknown
Properties
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
default()
default(config): OIDCConfig<DescopeProfile>
Setup
Callback URL
https://example.com/api/auth/callback/descope
Configuration
import { Auth } from "@auth/core"
import Descope from "@auth/core/providers/descope"
const request = new Request(origin)
const response = await Auth(request, {
providers: [
Descope({
clientId: DESCOPE_ID,
clientSecret: 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
Parameter | Type |
---|---|
config | OIDCUserConfig <DescopeProfile > |