providers/azure-ad-b2c
AzureADB2CProfile
請參閱
屬性
aud
aud: string;
auth_time
auth_time: number;
country
country: string;
emails
emails: string[];
exp
exp: number;
iat
iat: number;
iss
iss: string;
name
name: string;
nbf
nbf: number;
oid
oid: string;
postalCode
postalCode: string;
preferred_username
preferred_username: string;
sub
sub: string;
tfp
tfp: string;
ver
ver: string;
default()
default(options): OIDCConfig<AzureADB2CProfile>
將 Azure AD B2C 登入新增至您的頁面。
設定
基本
基本設定會設定 Azure AD B2C 以傳回 ID 權杖。在執行進階設定之前,應先完成此步驟作為先決條件。
針對「使用者屬性和權杖宣告」步驟,設定以下內容
- 收集屬性
- 電子郵件地址
- 顯示名稱
- 名字
- 姓氏
- 傳回宣告
- 電子郵件地址
- 顯示名稱
- 名字
- 姓氏
- 身分識別提供者
- 身分識別提供者存取權杖
- 使用者的物件 ID
參數
參數 | 類型 |
---|---|
選項 | OIDCUserConfig <AzureADB2CProfile > |
返回
範例
import { Auth } from "@auth/core"
import AzureADB2C from "@auth/core/providers/azure-ad-b2c"
const request = new Request("https://example.com")
const response = await AuthHandler(request, {
// optionally, you can pass `tenantId` and `primaryUserFlow` instead of `issuer`
providers: [AzureADB2C({ clientId: "", clientSecret: "", issuer: "" })],
})
資源
注意事項
預設情況下,Auth.js 假設 Azure AD B2C 提供者是基於 OIDC 規格。
💡
Azure AD B2C 提供者隨附 預設設定。若要覆寫您的使用案例的預設值,請查看自訂內建 OAuth 提供者。