Auth.js (Next.js)
Passage works as a custom OAuth authentication provider for NextAuth.js authentication.
Passage works as a custom OAuth authentication provider for NextAuth.js authentication.
Prerequisites
- A Passage app. Follow the Hosted Quickstart instructions when creating a Passage app.
- Optional: Learn more about Auth.js OIDC Providers
Passage provider
The Passage Provider is a fully supported OIDC provider that is included in the Auth.js core library.
Example Implementation
import Auth from '@auth/core';
import Passage from '@auth/core/providers/passage';
const request = new Request(origin);
const response = await Auth(request, {
providers: [
Passage({
clientId: PASSAGE_ID,
clientSecret: PASSAGE_SECRET,
issuer: PASSAGE_ISSUER,
}),
],
});
clientId
and clientSecret
can be found in the Authentication Experience tab on the Authentication page in Passage Console.
issuer
is the ‘Custom subdomain’ found on your Passage Settings General tab.