Auth0ClientOptions | @auth0/nextjs-auth0 - v4.6.1
Description: Documentation for @auth0/nextjs-auth0

# Interface Auth0ClientOptions

interface Auth0ClientOptions {
allowInsecureRequests?: boolean;
appBaseUrl?: string;
authorizationParameters?: AuthorizationParameters;
beforeSessionSaved?: BeforeSessionSavedHook;
clientAssertionSigningAlg?: string;
clientAssertionSigningKey?: string | CryptoKey;
clientId?: string;
clientSecret?: string;
domain?: string;
enableAccessTokenEndpoint?: boolean;
enableTelemetry?: boolean;
httpTimeout?: number;
onCallback?: OnCallbackHook;
pushedAuthorizationRequests?: boolean;
routes?: Partial<
Pick<Routes, "login" | "callback" | "logout" | "backChannelLogout">,
>;
secret?: string;
session?: SessionConfiguration;
sessionStore?: SessionDataStore;
signInReturnToPath?: string;
transactionCookie?: TransactionCookieOptions;
}

- Defined in src/server/client.ts:38

##### Index

### Properties

allowInsecureRequests?
appBaseUrl?
authorizationParameters?
beforeSessionSaved?
clientAssertionSigningAlg?
clientAssertionSigningKey?
clientId?
clientSecret?
domain?
enableAccessTokenEndpoint?
enableTelemetry?
httpTimeout?
onCallback?
pushedAuthorizationRequests?
routes?
secret?
session?
sessionStore?
signInReturnToPath?
transactionCookie?

## Properties

### `Optional`allowInsecureRequests

allowInsecureRequests?: boolean

Allow insecure requests to be made to the authorization server. This can be useful when testing with a mock OIDC provider that does not support TLS, locally. This option can only be used when NODE_ENV is not set to `production`.

- Defined in src/server/client.ts:145

### `Optional`appBaseUrl

appBaseUrl?: string

The URL of your application (e.g.: `http://localhost:3000`).

If it's not specified, it will be loaded from the `APP_BASE_URL` environment variable.

- Defined in src/server/client.ts:85

### `Optional`authorizationParameters

authorizationParameters?: AuthorizationParameters

Additional parameters to send to the `/authorize` endpoint.

- Defined in src/server/client.ts:61

### `Optional`beforeSessionSaved

beforeSessionSaved?: BeforeSessionSavedHook

A method to manipulate the session before persisting it.

See beforeSessionSaved for additional details

- Defined in src/server/client.ts:117

### `Optional`clientAssertionSigningAlg

clientAssertionSigningAlg?: string

The algorithm used to sign the client assertion JWT. Uses one of `token_endpoint_auth_signing_alg_values_supported` if not specified. If the Authorization Server discovery document does not list `token_endpoint_auth_signing_alg_values_supported` this property will be required.

- Defined in src/server/client.ts:77

### `Optional`clientAssertionSigningKey

clientAssertionSigningKey?: string | CryptoKey

Private key for use with `private_key_jwt` clients. This should be a string that is the contents of a PEM file or a CryptoKey.

- Defined in src/server/client.ts:70

### `Optional`clientId

clientId?: string

The Auth0 client ID.

If it's not specified, it will be loaded from the `AUTH0_CLIENT_ID` environment variable.

- Defined in src/server/client.ts:51

### `Optional`clientSecret

clientSecret?: string

The Auth0 client secret.

If it's not specified, it will be loaded from the `AUTH0_CLIENT_SECRET` environment variable.

- Defined in src/server/client.ts:57

### `Optional`domain

domain?: string

The Auth0 domain for the tenant (e.g.: `example.us.auth0.com`).

If it's not specified, it will be loaded from the `AUTH0_DOMAIN` environment variable.

- Defined in src/server/client.ts:45

### `Optional`enableAccessTokenEndpoint

enableAccessTokenEndpoint?: boolean

Boolean value to enable the `/auth/access-token` endpoint for use in the client app.

Defaults to `true`.

NOTE: Set this to `false` if your client does not need to directly interact with resource servers (Token Mediating Backend). This will be false for most apps.

A security best practice is to disable this to avoid exposing access tokens to the client app.

See: https://datatracker.ietf.org/doc/html/draft-ietf-oauth-browser-based-apps#name-token-mediating-backend

- Defined in src/server/client.ts:170

### `Optional`enableTelemetry

enableTelemetry?: boolean

Boolean value to opt-out of sending the library name and version to your authorization server via the `Auth0-Client` header. Defaults to `true`.

- Defined in src/server/client.ts:157

### `Optional`httpTimeout

httpTimeout?: number

Integer value for the HTTP timeout in milliseconds for authentication requests. Defaults to `5000` ms.

- Defined in src/server/client.ts:151

### `Optional`onCallback

onCallback?: OnCallbackHook

A method to handle errors or manage redirects after attempting to authenticate.

See onCallback for additional details

- Defined in src/server/client.ts:123

### `Optional`pushedAuthorizationRequests

pushedAuthorizationRequests?: boolean

If enabled, the SDK will use the Pushed Authorization Requests (PAR) protocol when communicating with the authorization server.

- Defined in src/server/client.ts:65

### `Optional`routes

routes?: Partial<
Pick<Routes, "login" | "callback" | "logout" | "backChannelLogout">,
>

Configure the paths for the authentication routes.

See Custom routes for additional details.

- Defined in src/server/client.ts:138

### `Optional`secret

secret?: string

A 32-byte, hex-encoded secret used for encrypting cookies.

If it's not specified, it will be loaded from the `AUTH0_SECRET` environment variable.

- Defined in src/server/client.ts:91

### `Optional`session

session?: SessionConfiguration

Configure the session timeouts and whether to use rolling sessions or not.

See Session configuration for additional details.

- Defined in src/server/client.ts:103

### `Optional`sessionStore

sessionStore?: SessionDataStore

A custom session store implementation used to persist sessions to a data store.

See Database sessions for additional details.

- Defined in src/server/client.ts:131

### `Optional`signInReturnToPath

signInReturnToPath?: string

The path to redirect the user to after successfully authenticating. Defaults to `/`.

- Defined in src/server/client.ts:95

### `Optional`transactionCookie

transactionCookie?: TransactionCookieOptions

Configure the transaction cookie used to store the state of the authentication transaction.

- Defined in src/server/client.ts:109