IdentityBuilder Class

Definition

Helper functions for configuring identity services.

public ref class IdentityBuilder
public class IdentityBuilder
type IdentityBuilder = class
Public Class IdentityBuilder
Inheritance
IdentityBuilder

Constructors

IdentityBuilder(Type, IServiceCollection)

Creates a new instance of IdentityBuilder.

IdentityBuilder(Type, Type, IServiceCollection)

Creates a new instance of IdentityBuilder.

Properties

RoleType

Gets the Type used for roles.

Services

Gets the IServiceCollection services are attached to.

UserType

Gets the Type used for users.

Methods

AddClaimsPrincipalFactory<TFactory>()

Adds an IUserClaimsPrincipalFactory<TUser> for the UserType.

AddDefaultTokenProviders()

Adds the default token providers used to generate tokens for reset passwords, change email and change telephone number operations, and for two factor authentication token generation.

AddErrorDescriber<TDescriber>()

Adds an IdentityErrorDescriber.

AddPasswordValidator<TValidator>()

Adds an IPasswordValidator<TUser> for the UserType.

AddPersonalDataProtection<TProtector,TKeyRing>()

Adds an ILookupProtector and ILookupProtectorKeyRing.

AddRoleManager<TRoleManager>()

Adds a RoleManager<TRole> for the RoleType.

AddRoles<TRole>()

Adds Role related services for TRole, including IRoleStore, IRoleValidator, and RoleManager.

AddRoleStore<TStore>()

Adds a IRoleStore<TRole> for the RoleType.

AddRoleValidator<TRole>()

Adds an IRoleValidator<TRole> for the RoleType.

AddSignInManager<TSignInManager>()

Adds a SignInManager<TUser> for the .

AddTokenProvider(String, Type)

Adds a token provider for the UserType.

AddTokenProvider<TProvider>(String)

Adds a token provider.

AddUserConfirmation<TUserConfirmation>()

Adds a IUserConfirmation<TUser> for the .

AddUserManager<TUserManager>()

Adds a UserManager<TUser> for the UserType.

AddUserStore<TStore>()

Adds an IUserStore<TUser> for the UserType.

AddUserValidator<TValidator>()

Adds an IUserValidator<TUser> for the UserType.

Extension Methods

AddApiEndpoints(IdentityBuilder)

Adds configuration and services needed to support MapIdentityApi<TUser>(IEndpointRouteBuilder) but does not configure authentication. Call AddBearerToken(AuthenticationBuilder, Action<BearerTokenOptions>) and/or AddIdentityCookies(AuthenticationBuilder) to configure authentication separately.

AddDefaultTokenProviders(IdentityBuilder)

Adds the default token providers used to generate tokens for reset passwords, change email and change telephone number operations, and for two factor authentication token generation.

AddSignInManager(IdentityBuilder)

Adds a SignInManager<TUser> for the UserType.

AddSignInManager<TSignInManager>(IdentityBuilder)

Adds a SignInManager<TUser> for the UserType.

AddDefaultUI(IdentityBuilder)

Adds a default, self-contained UI for Identity to the application using Razor Pages in an area named Identity.

AddDefaultUI(IdentityBuilder, UIFramework)

Adds a default, self-contained UI for Identity to the application using Razor Pages in an area named Identity.

AddEntityFrameworkStores<TContext>(IdentityBuilder)

Adds an Entity Framework implementation of identity information stores.

AddEntityFrameworkStores<TContext,TKey>(IdentityBuilder)

Applies to