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

Passage provider

The Passage Provider (opens in a new tab) 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 (opens in a new tab)