IdentityBuilder Class¶
Helper functions for configuring identity services.
- Namespace
Microsoft.AspNetCore.Identity
- Assemblies
- Microsoft.AspNetCore.Identity
Constructors¶
-
IdentityBuilder
(System.Type, System.Type, Microsoft.Extensions.DependencyInjection.IServiceCollection)¶ Creates a new instance of
Microsoft.AspNetCore.Identity.IdentityBuilder
.Arguments: - user (System.Type) – The
System.Type
to use for the users. - role (System.Type) – The
System.Type
to use for the roles. - services (Microsoft.Extensions.DependencyInjection.IServiceCollection) – The
Microsoft.Extensions.DependencyInjection.IServiceCollection
to attach to.
public IdentityBuilder(Type user, Type role, IServiceCollection services)
- user (System.Type) – The
-
Methods¶
-
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.
Return type: Microsoft.AspNetCore.Identity.IdentityBuilder Returns: The current Microsoft.AspNetCore.Identity.IdentityBuilder
instance.public virtual IdentityBuilder AddDefaultTokenProviders()
-
AddErrorDescriber<TDescriber>
()¶ Adds an
Microsoft.AspNetCore.Identity.IdentityErrorDescriber
.Return type: Microsoft.AspNetCore.Identity.IdentityBuilder Returns: The current Microsoft.AspNetCore.Identity.IdentityBuilder
instance.public virtual IdentityBuilder AddErrorDescriber<TDescriber>()where TDescriber : IdentityErrorDescriber
-
AddPasswordValidator<T>
()¶ Adds an
Microsoft.AspNetCore.Identity.IPasswordValidator`1
for theMicrosoft.AspNetCore.Identity.IdentityBuilder.UserType
.Return type: Microsoft.AspNetCore.Identity.IdentityBuilder Returns: The current Microsoft.AspNetCore.Identity.IdentityBuilder
instance.public virtual IdentityBuilder AddPasswordValidator<T>()where T : class
-
AddRoleManager<TRoleManager>
()¶ Adds a
Microsoft.AspNetCore.Identity.RoleManager`1
for theMicrosoft.AspNetCore.Identity.IdentityBuilder.RoleType
.Return type: Microsoft.AspNetCore.Identity.IdentityBuilder Returns: The current Microsoft.AspNetCore.Identity.IdentityBuilder
instance.public virtual IdentityBuilder AddRoleManager<TRoleManager>()where TRoleManager : class
-
AddRoleStore<T>
()¶ Adds a
Microsoft.AspNetCore.Identity.IRoleStore`1
for theMicrosoft.AspNetCore.Identity.IdentityBuilder.RoleType
.Return type: Microsoft.AspNetCore.Identity.IdentityBuilder Returns: The current Microsoft.AspNetCore.Identity.IdentityBuilder
instance.public virtual IdentityBuilder AddRoleStore<T>()where T : class
-
AddRoleValidator<T>
()¶ Adds an
Microsoft.AspNetCore.Identity.IRoleValidator`1
for theMicrosoft.AspNetCore.Identity.IdentityBuilder.RoleType
.Return type: Microsoft.AspNetCore.Identity.IdentityBuilder Returns: The current Microsoft.AspNetCore.Identity.IdentityBuilder
instance.public virtual IdentityBuilder AddRoleValidator<T>()where T : class
-
AddTokenProvider
(System.String, System.Type)¶ Adds a token provider for the
Microsoft.AspNetCore.Identity.IdentityBuilder.UserType
.Arguments: - providerName (System.String) – The name of the provider to add.
- provider (System.Type) – The type of the
Microsoft.AspNetCore.Identity.IUserTwoFactorTokenProvider`1
to add.
Return type: Returns: The current
Microsoft.AspNetCore.Identity.IdentityBuilder
instance.public virtual IdentityBuilder AddTokenProvider(string providerName, Type provider)
-
AddTokenProvider<TProvider>
(System.String)¶ Adds a token provider.
Arguments: providerName (System.String) – The name of the provider to add. Return type: Microsoft.AspNetCore.Identity.IdentityBuilder Returns: The current Microsoft.AspNetCore.Identity.IdentityBuilder
instance.public virtual IdentityBuilder AddTokenProvider<TProvider>(string providerName)where TProvider : class
-
AddUserManager<TUserManager>
()¶ Adds a
Microsoft.AspNetCore.Identity.UserManager`1
for theMicrosoft.AspNetCore.Identity.IdentityBuilder.UserType
.Return type: Microsoft.AspNetCore.Identity.IdentityBuilder Returns: The current Microsoft.AspNetCore.Identity.IdentityBuilder
instance.public virtual IdentityBuilder AddUserManager<TUserManager>()where TUserManager : class
-
AddUserStore<T>
()¶ Adds an
Microsoft.AspNetCore.Identity.IUserStore`1
for theMicrosoft.AspNetCore.Identity.IdentityBuilder.UserType
.Return type: Microsoft.AspNetCore.Identity.IdentityBuilder Returns: The current Microsoft.AspNetCore.Identity.IdentityBuilder
instance.public virtual IdentityBuilder AddUserStore<T>()where T : class
-
AddUserValidator<T>
()¶ Adds an
Microsoft.AspNetCore.Identity.IUserValidator`1
for theMicrosoft.AspNetCore.Identity.IdentityBuilder.UserType
.Return type: Microsoft.AspNetCore.Identity.IdentityBuilder Returns: The current Microsoft.AspNetCore.Identity.IdentityBuilder
instance.public virtual IdentityBuilder AddUserValidator<T>()where T : class
-
Properties¶
-
Microsoft.AspNetCore.Identity.IdentityBuilder.
RoleType
¶ Gets the
System.Type
used for roles.Return type: System.Type Returns: The System.Type
used for roles.public Type RoleType { get; }
-
Microsoft.AspNetCore.Identity.IdentityBuilder.
Services
¶ Gets the
Microsoft.Extensions.DependencyInjection.IServiceCollection
services are attached to.Return type: Microsoft.Extensions.DependencyInjection.IServiceCollection Returns: The Microsoft.Extensions.DependencyInjection.IServiceCollection
services are attached to.public IServiceCollection Services { get; }
-
Microsoft.AspNetCore.Identity.IdentityBuilder.
UserType
¶ Gets the
System.Type
used for users.Return type: System.Type Returns: The System.Type
used for users.public Type UserType { get; }
-