Class BackOfficeIdentityBuilder
Provides a builder for configuring identity options and services specific to the Umbraco back office.
Inheritance
Namespace: Umbraco.Cms.Core.Security
Assembly: Umbraco.Infrastructure.dll
Syntax
public class BackOfficeIdentityBuilder : IdentityBuilder
Constructors
View SourceBackOfficeIdentityBuilder(IServiceCollection)
Initializes a new instance of the BackOfficeIdentityBuilder class.
Declaration
public BackOfficeIdentityBuilder(IServiceCollection services)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceCollection | services |
BackOfficeIdentityBuilder(Type, IServiceCollection)
Initializes a new instance of the BackOfficeIdentityBuilder class.
Declaration
public BackOfficeIdentityBuilder(Type role, IServiceCollection services)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | role | The System.Type representing the user role for the back office identity. |
| IServiceCollection | services | The Microsoft.Extensions.DependencyInjection.IServiceCollection to which identity services will be added. |
Methods
View SourceAddErrorDescriber<TDescriber>()
Adds a custom error describer of the specified type to the identity builder for back office authentication.
Declaration
public override IdentityBuilder AddErrorDescriber<TDescriber>() where TDescriber : IdentityErrorDescriber
Returns
| Type | Description |
|---|---|
| IdentityBuilder | The current Microsoft.AspNetCore.Identity.IdentityBuilder instance for chaining. |
Type Parameters
| Name | Description |
|---|---|
| TDescriber | The type of the error describer to add. Must inherit from BackOfficeErrorDescriber. |
Remarks
override to add itself, by default identity only wants a single IdentityErrorDescriber
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Thrown if |
AddTokenProvider(string, Type)
Adds a token provider for the BackOfficeIdentityUser.
Declaration
public override IdentityBuilder AddTokenProvider(string providerName, Type provider)
Parameters
| Type | Name | Description |
|---|---|---|
| string | providerName | The name of the provider to add. |
| Type | provider | The type of the Microsoft.AspNetCore.Identity.IUserTwoFactorTokenProvider<TUser> to add. |
Returns
| Type | Description |
|---|---|
| IdentityBuilder | The current Microsoft.AspNetCore.Identity.IdentityBuilder instance. |