Skip to content
Migrating from NextAuth.js v4? Read our migration guide.
API reference
okta

providers/okta

Built-in Okta integration.

OktaProfile

Extends

  • Record<string, any>

Properties

address

address: string;

amr

amr: string;

at_hash

at_hash: string;

aud

aud: string;

auth_time

auth_time: string;

birthdate

birthdate: string;

c_hash

c_hash: string;

email

email: string;

email_verified

email_verified: string;

exp

exp: string;

family_name

family_name: string;

gender

gender: string;

given_name

given_name: string;

iat

iat: string;

idp

idp: string;

iss

iss: string;

jti

jti: string;

locale

locale: string;

middle_name

middle_name: string;

name

name: string;

nickname

nickname: string;

nonce

nonce: string;

phone_number

phone_number: string;

picture

picture: string;

preferred_username

preferred_username: string;

profile

profile: string;

sub

sub: string;

updated_at

updated_at: string;

ver

ver: string;

website

website: string;

zoneinfo

zoneinfo: string;

default()

default<P>(options): OAuthConfig<P>

Add Okta login to your page.

Setup

Callback URL

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

Configuration

import { Auth } from "@auth/core"
import Okta from "@auth/core/providers/okta"
 
const request = new Request(origin)
const response = await Auth(request, {
  providers: [
    Okta({
      clientId: OKTA_CLIENT_ID,
      clientSecret: OKTA_CLIENT_SECRET,
      issuer: OKTA_ISSUER,
    }),
  ],
})

Resources

Notes

By default, Auth.js assumes that the Okta provider is based on the Open ID Connect specification.

💡

The Okta provider comes with a default configuration. To override the defaults for your use case, check out customizing a built-in OAuth provider.

Disclaimer 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.

Type parameters

Type parameter
P extends OktaProfile

Parameters

ParameterType
optionsOAuthUserConfig<P>

Returns

OAuthConfig<P>

Auth.js © Balázs Orbán and Team - 2024