跳至內容
從 NextAuth.js v4 遷移?請閱讀 我們的遷移指南.
開始使用供應商Duende Identity Server6

Duende Identity Server 供應商

資源

設定

回呼 URL

https://example.com/api/auth/callback/duende-identity-service

環境變數

AUTH_DUENDE_IDENTITY_SERVER6_ID
AUTH_DUENDE_IDENTITY_SERVER6_SECRET
AUTH_DUENDE_IDENTITY_SERVER6_ISSUER

組態

/auth.ts
import NextAuth from "next-auth"
import DuendeIdentityServer6 from "next-auth/providers/duende-identity-server6"
 
export const { handlers, auth, signIn, signOut } = NextAuth({
  providers: [DuendeIdentityServer6],
})

示範 IdentityServer

以下組態適用於 https://demo.duendesoftware.com/ 的示範伺服器

如果您想嘗試,可以複製並貼上以下組態。

您可以使用 bob/bobalice/alice 登入示範服務。

import DuendeIDS6Provider from "next-auth/providers/duende-identity-server6"
providers: [
  DuendeIDS6Provider({
    clientId: "interactive.confidential",
    clientSecret: "secret",
    issuer: "https://demo.duendesoftware.com",
  }),
]
Auth.js © Balázs Orbán 和團隊 -2024