Skip to main content

providers/descope

Built-in sign in with Descope integration.

default()​

Setup​

Callback URL​

https://example.com/api/auth/callback/descope

Configuration​

Import the provider and configure it in your Auth.js initialization file:

pages/api/auth/[...nextauth].ts
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:

  1. Log into the Descope console
  2. 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.

info

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.

default(config: OIDCUserConfig<DescopeProfile>): OIDCConfig<DescopeProfile>

Parameters​

ParameterType
configOIDCUserConfig<DescopeProfile>

Returns​

OIDCConfig<DescopeProfile>


DescopeProfile​

The returned user profile from Descope when using the profile callback.

Properties​

sub​

sub: string

The user Descope ID