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

providers/ory-hydra

Built-in Ory Hydra integration.

OryHydraProfile

Extends

  • Record<string, any>

Properties

amr

amr: string;

aud

aud: string;

email?

optional email: string;

exp

exp: string;

iat

iat: string;

iss

iss: string;

jti

jti: string;

sub

sub: string;

ver

ver: string;

default()

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

Add Ory Hydra login to your page.

Setup

Callback URL

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

Configuration

import Auth from "@auth/core"
import OryHydra from "@auth/core/providers/ory-hydra"
 
const request = new Request(origin)
const response = await Auth(request, {
  providers: [OryHydra({ clientId: ORY_HYDRA_CLIENT_ID, clientSecret: ORY_HYDRA_CLIENT_SECRET, issuer: ORY_HYDRA_ISSUER })],
})

Resources

Notes

Ory Hydra can be setup using the default Ory Network setup or self hosted on your own infrastructure. By default, Auth.js assumes that the Ory Hydra provider is based on the Open ID Connect specification.

💡

The Ory Hydra 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 OryHydraProfile

Parameters

ParameterType
optionsOIDCUserConfig<P>

Returns

OIDCConfig<P>

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