Frontend Integration
Next.js can be easily integrated to your Next.js (opens in a new tab) project using the popular NextAuth.js (opens in a new tab) library. Here is a quick tutorial using their excellent example app (opens in a new tab):

  1. Clone the repository and install dependencies
git clone
cd next-auth-example
npm install
  1. modify auth.ts to add configuration
import type { OIDCConfig } from "@auth/core/providers"
import type { NextAuthConfig, Profile } from "next-auth"
// add this configuration to providers list:
      id: "justpass",
      name: "",
      type: "oidc",
      issuer: "https://{ORGANIZATION_NAME}",
      clientId: process.env.AUTH_JUSTPASSME_ID,
      clientSecret: process.env.AUTH_JUSTPASSME_SECRET,
    } satisfies OIDCConfig<Profile>
  1. copy .env.local.example to .env.local and add the client id and secret variables
  1. run project
npm run dev

2024 ©