IdentityBuilder 類別

定義

用於設定身分識別服務的協助程式函式。

public ref class IdentityBuilder
public class IdentityBuilder
type IdentityBuilder = class
Public Class IdentityBuilder
繼承
IdentityBuilder

建構函式

IdentityBuilder(Type, IServiceCollection)

建立 IdentityBuilder 的新執行個體。

IdentityBuilder(Type, Type, IServiceCollection)

建立 IdentityBuilder 的新執行個體。

屬性

RoleType

Type取得用於角色的 。

Services

取得附加 IServiceCollection 至的服務。

UserType

Type取得用於使用者的 。

方法

AddClaimsPrincipalFactory<TFactory>()

IUserClaimsPrincipalFactory<TUser>加入 的 UserType

AddDefaultTokenProviders()

新增用來產生重設密碼、變更電子郵件和變更電話號碼作業,以及產生雙因素驗證權杖的預設權杖提供者。

AddErrorDescriber<TDescriber>()

IdentityErrorDescriber加入 。

AddPasswordValidator<TValidator>()

IPasswordValidator<TUser>加入 的 UserType

AddPersonalDataProtection<TProtector,TKeyRing>()

ILookupProtector加入 和 ILookupProtectorKeyRing

AddRoleManager<TRoleManager>()

RoleManager<TRole>加入 的 RoleType

AddRoles<TRole>()

新增 TRole 的角色相關服務,包括 IRoleStore、IRoleValidator 和 RoleManager。

AddRoleStore<TStore>()

IRoleStore<TRole>加入 的 RoleType

AddRoleValidator<TRole>()

IRoleValidator<TRole>加入 的 RoleType

AddSignInManager<TSignInManager>()

SignInManager<TUser>加入 的 。

AddTokenProvider(String, Type)

加入 的 UserType 權杖提供者。

AddTokenProvider<TProvider>(String)

新增權杖提供者。

AddUserConfirmation<TUserConfirmation>()

IUserConfirmation<TUser>加入 的 。

AddUserManager<TUserManager>()

UserManager<TUser>加入 的 UserType

AddUserStore<TStore>()

IUserStore<TUser>加入 的 UserType

AddUserValidator<TValidator>()

IUserValidator<TUser>加入 的 UserType

擴充方法

AddApiEndpoints(IdentityBuilder)

新增支援 MapIdentityApi<TUser>(IEndpointRouteBuilder) 所需的組態和服務,但不會設定驗證。 分別呼叫 AddBearerToken(AuthenticationBuilder, Action<BearerTokenOptions>) 和/或 AddIdentityCookies(AuthenticationBuilder) 以設定驗證。

AddDefaultTokenProviders(IdentityBuilder)

新增用來產生重設密碼、變更電子郵件和變更電話號碼作業,以及產生雙因素驗證權杖的預設權杖提供者。

AddSignInManager(IdentityBuilder)

SignInManager<TUser>加入 的 UserType

AddSignInManager<TSignInManager>(IdentityBuilder)

SignInManager<TUser>加入 的 UserType

AddDefaultUI(IdentityBuilder)

使用名為 Identity 之區域中的 Razor Pages,將身分識別的預設獨立 UI 新增至應用程式。

AddDefaultUI(IdentityBuilder, UIFramework)

使用名為 Identity 之區域中的 Razor Pages,將身分識別的預設獨立 UI 新增至應用程式。

AddEntityFrameworkStores<TContext>(IdentityBuilder)

新增身分識別資訊存放區的 Entity Framework 實作。

AddEntityFrameworkStores<TContext,TKey>(IdentityBuilder)

用於設定身分識別服務的協助程式函式。

適用於