跳至內容
從 NextAuth.js v4 遷移?請閱讀 我們的遷移指南.

providers/descope

內建與 Descope 整合的登入功能。

DescopeProfile

使用 profile 回呼時,從 Descope 返回的使用者設定檔。 請參閱「載入使用者」

可索引

[claim: string]: unknown

屬性

email

email: string;

使用者的電子郵件

email_verified

email_verified: boolean;

布林值,指出使用者的電子郵件是否已驗證

name

name: string;

使用者的名稱

phone_number

phone_number: string;

使用者的電話號碼

phone_number_verified

phone_number_verified: boolean;

布林值,指出使用者的電話號碼是否已驗證

picture

picture: string;

使用者的圖片

sub

sub: string;

使用者唯一的 Descope ID


default()

default(config): OIDCConfig<DescopeProfile>

設定

回呼 URL

https://example.com/api/auth/callback/descope

設定

import { Auth } from "@auth/core"
import Descope from "@auth/core/providers/descope"
 
const request = new Request(origin)
const response = await Auth(request, { providers: [Descope({ clientId: AUTH_DESCOPE_ID, clientSecret: AUTH_DESCOPE_SECRET, issuer: AUTH_DESCOPE_ISSUER })] })

設定 Descope

請按照以下步驟執行

  1. 登入 Descope 主控台
  2. 按照 OIDC 指示執行

然後,在專案根目錄中建立 .env.local 檔案,並加入下列項目

從 Descope 主控台取得下列項目

AUTH_DESCOPE_ID="<Descope Issuer's last url segment>" # Descope's Issuer can be found in "Authentication Methods > SSO > Identity Provider" (Can also be taken from "Project > Project ID")
AUTH_DESCOPE_SECRET="<Descope Access Key>" # Manage > Access Keys
AUTH_DESCOPE_ISSUER="<Descope Issuer URL>" # Applications -> OIDC Application -> Issuer

資源

注意事項

Descope 供應商隨附 預設設定。若要覆寫您使用案例的預設值,請查看 自訂內建 OAuth 供應商

依預設,Auth.js 假設 Descope 供應商是以 OIDC 規格為基礎

協助

如果您認為在預設設定中發現錯誤,可以開啟問題

Auth.js 嚴格遵守規格,並且不對供應商的任何規格偏差負責。您可以開啟問題,但如果問題是不符合規格,我們可能不會尋求解決方案。您可以在討論區中尋求更多協助。

參數

參數類型
configOIDCUserConfig<DescopeProfile>

返回

OIDCConfig<DescopeProfile>

Auth.js © Balázs Orbán 與團隊 -2024