Auth.js (Next.js)

Passage + Auth.js + Next.js

Passage works as a custom OAuth authentication provider for NextAuth.js authentication.

Prerequisites

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 on your Passage Settings OIDC tab.

issuer is the 'Custom subdomain' found on your Passage Settings General tab.

For further details reference the Auth.js documentation here.

Last updated