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

Asgardeo Provider

Resources

Setup

Callback URL

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

Environment Variables

AUTH_ASGARDEO_ID
AUTH_ASGARDEO_SECRET

Configuration

Follow these steps:

  1. Log into the Asgardeo console
  2. Next, go to “Application” tab (more info here)
  3. Register a standard based, Open ID connect, application
  4. Add the callback URLs: http://localhost:3000/api/auth/callback/asgardeo (development) and https://{YOUR_DOMAIN}.com/api/auth/callback/asgardeo (production)
  5. After registering the application, go to “Protocol” tab.
  6. Check code as the grant type.
  7. Add “Authorized redirect URLs” & “Allowed origins fields”
  8. Make Email, First Name, Photo URL user attributes mandatory from the console.

Then, add the ClientID, ClientSecret, and Issuer values to your environment variables.

/auth.ts
import NextAuth from "next-auth"
import Asgardeo from "next-auth/providers/asgardeo"
 
export const { handlers, auth, signIn, signOut } = NextAuth({
  providers: [Asgardeo],
})
Auth.js © Balázs Orbán and Team - 2024