IdentityServiceCollectionExtensions Class

Summary

Contains extension methods to IServiceCollection for configuring identity services.

Syntax

public class IdentityServiceCollectionExtensions

GitHub

View on GitHub

class Microsoft.Framework.DependencyInjection.IdentityServiceCollectionExtensions

Methods

AddIdentity<TUser, TRole>(IServiceCollection)

Adds the default identity system configuration for the specified User and Role types.

Arguments:
  • services (IServiceCollection) – The services available in the application.
Return type:

Microsoft.AspNet.Identity.IdentityBuilder

Returns:

An <see cref=”T:Microsoft.AspNet.Identity.IdentityBuilder” /> for creating and configuring the identity system.

public static IdentityBuilder AddIdentity<TUser, TRole>(IServiceCollection services)where TUser : class where TRole : class
AddIdentity<TUser, TRole>(IServiceCollection, System.Action<Microsoft.AspNet.Identity.IdentityOptions>)

Adds and configures the identity system for the specified User and Role types.

Arguments:
  • services (IServiceCollection) – The services available in the application.
  • setupAction (System.Action{Microsoft.AspNet.Identity.IdentityOptions}) – An action to configure the Microsoft.AspNet.Identity.IdentityOptions.
Return type:

Microsoft.AspNet.Identity.IdentityBuilder

Returns:

An <see cref=”T:Microsoft.AspNet.Identity.IdentityBuilder” /> for creating and configuring the identity system.

public static IdentityBuilder AddIdentity<TUser, TRole>(IServiceCollection services, Action<IdentityOptions> setupAction)where TUser : class where TRole : class
ConfigureIdentity(IServiceCollection, IConfiguration)

Configures a set of Microsoft.AspNet.Identity.IdentityOptions for the application

Arguments:
  • services (IServiceCollection) – The services available in the application.
  • config (IConfiguration) – The configuration for the Microsoft.AspNet.Identity.IdentityOptions.
Return type:

IServiceCollection

Returns:

The <see cref=”!:IServiceCollection” /> instance this method extends.

public static IServiceCollection ConfigureIdentity(IServiceCollection services, IConfiguration config)
ConfigureIdentity(IServiceCollection, System.Action<Microsoft.AspNet.Identity.IdentityOptions>)

Configures a set of Microsoft.AspNet.Identity.IdentityOptions for the application

Arguments:
  • services (IServiceCollection) – The services available in the application.
  • setupAction (System.Action{Microsoft.AspNet.Identity.IdentityOptions}) – An action to configure the Microsoft.AspNet.Identity.IdentityOptions.
Return type:

IServiceCollection

Returns:

The <see cref=”!:IServiceCollection” /> instance this method extends.

public static IServiceCollection ConfigureIdentity(IServiceCollection services, Action<IdentityOptions> setupAction)
ConfigureIdentityApplicationCookie(IServiceCollection, System.Action<CookieAuthenticationOptions>)

Configures a set of CookieAuthenticationOptions for the application

Arguments:
  • services (IServiceCollection) – The services available in the application.
  • setupAction (System.Action{CookieAuthenticationOptions}) – An action to configure the CookieAuthenticationOptions.
Return type:

IServiceCollection

Returns:

The <see cref=”!:IServiceCollection” /> instance this method extends.

public static IServiceCollection ConfigureIdentityApplicationCookie(IServiceCollection services, Action<CookieAuthenticationOptions> setupAction)