This is a sample project that demonstrates how to integrate Asgardeo with a Next.js application using the auth.js library. Each step in the guide is corresponding to the folders in the project.
- Node.js
- npm
- An Asgardeo account
- Go to each folder in the project
cd step-1
- Create a
.env.local
file in the root of the project and add the following environment variables
AUTH_SECRET="" # Added by `npx auth`. Read more: https://cli.authjs.dev
AUTH_ASGARDEO_ID=""
AUTH_ASGARDEO_SECRET=""
AUTH_ASGARDEO_ISSUER="https://api.asgardeo.io/t/{org_name}/oauth2/token"
NEXT_PUBLIC_AUTH_ASGARDEO_LOGOUT_URL="https://api.asgardeo.io/t/{org_name}/oidc/logout"
NEXT_PUBLIC_AUTH_ASGARDEO_POST_LOGOUT_REDIRECT_URL="http://localhost:3000/auth/sign-out"
NEXT_PUBLIC_AUTH_ASGARDEO_ME_ENDPOINT="https://api.asgardeo.io/t/{org_name}/scim2/Me"
- Install dependencies
npm install
- Run the project
npm run dev