Skip to main content

providers/fusionauth

Built-in FusionAuth integration.

default()​

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

Add FusionAuth login to your page.

Setup​

Callback URL​

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

Configuration​

import Auth from "@auth/core"
import FusionAuth from "@auth/core/providers/fusionauth"

const request = new Request(origin)
const response = await Auth(request, {
providers: [FusionAuth({ clientId: FUSIONAUTH_CLIENT_ID, clientSecret: FUSIONAUTH_CLIENT_SECRET, tenantId: FUSIONAUTH_TENANT_ID, issuer: FUSIONAUTH_ISSUER })],
})
warning

If you're using multi-tenancy, you need to pass in the tenantId option to apply the proper theme.

Resources​

Notes​

By default, Auth.js assumes that the FusionAuth provider is based on the OAuth 2 specification.

Configuration​

tip

An application can be created at https://your-fusionauth-server-url/admin/application.

For more information, follow the FusionAuth 5-minute setup guide.

In the OAuth settings for your application, configure the following.

If using JSON Web Tokens, you need to make sure the signing algorithm is RS256, you can create an RS256 key pair by going to Settings, Key Master, generate RSA and choosing SHA-256 as algorithm. After that, go to the JWT settings of your application and select this key as Access Token signing key and Id Token signing key.

tip

The FusionAuth 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​

β–ͺ P extends FusionAuthProfile

Parameters​

β–ͺ options: OAuthUserConfig< P > & object

Returns​

OAuthConfig< P >


FusionAuthProfile​

This is the default openid signature returned from FusionAuth it can be customized using lambda functions

Extends​

  • Record< string, any >