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

providers/ory

Built-in Ory integration.

DefaultOryProfile

Extends

  • Record<string, any>

Properties

amr

amr: string;

aud

aud: string;

email?

optional email: string;

email_verified?

optional email_verified: boolean;

exp

exp: string;

family_name?

optional family_name: string;

given_name?

optional given_name: string;

iat

iat: string;

iss

iss: string;

jti

jti: string;

name?

optional name: string;

preferred_username?

optional preferred_username: string;

sub

sub: string;

updated_at?

optional updated_at: Date;

ver

ver: string;

website?

optional website: string;

default()

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

Add login with Ory to your app.

Setup

Callback URL

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

Configuration

import Auth from "@auth/core"
import Ory from "@auth/core/providers/ory"
 
const request = new Request(origin)
const response = await Auth(request, {
  providers: [Ory({
    clientId: ORY_CLIENT_ID,
    clientSecret: ORY_CLIENT_SECRET,
    issuer: ORY_SDK_URL // https://ory.yourdomain.com
  })],
})

Resources

Notes

This set up is optimized for Ory Network, a managed service by Ory. To use Auth.js with self-hosted Ory Hydra, use the OryHydra provider.

The Ory integration is based on the Open ID Connect specification.

💡

The Ory 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 DefaultOryProfile

Parameters

ParameterType
optionsOIDCUserConfig<P>

Returns

OIDCConfig<P>

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