Asgardeo Provider
Resources
Setup
Callback URL
https://example.com/api/auth/callback/asgardeo
Environment Variables
AUTH_ASGARDEO_ID
AUTH_ASGARDEO_SECRET
AUTH_ASGARDEO_ISSUER
Configuration
Follow these steps:
- Log into the Asgardeo console
- Next, go to “Application” tab (more info here)
- Register a standard based, Open ID connect, application
- Add the callback URLs:
http://localhost:3000/api/auth/callback/asgardeo
(development) andhttps://{YOUR_DOMAIN}.com/api/auth/callback/asgardeo
(production) - After registering the application, go to “Protocol” tab.
- Check
code
as the grant type. - Add “Authorized redirect URLs” & “Allowed origins fields”
- 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],
})