Table of Contents

Class MicrosoftIdentityWebAppServiceCollectionExtensions

Namespace
Microsoft.Identity.Web
Assembly
Microsoft.Identity.Web.dll

Extension for IServiceCollection for startup initialization.

public static class MicrosoftIdentityWebAppServiceCollectionExtensions
Inheritance
MicrosoftIdentityWebAppServiceCollectionExtensions
Inherited Members

Methods

AddMicrosoftIdentityWebAppAuthentication(IServiceCollection, IConfiguration, string, string, string, bool, string?)

Add authentication with Microsoft identity platform. This method expects the configuration file will have a section, (by default named "AzureAd"), with the necessary settings to initialize the authentication options.

public static MicrosoftIdentityWebAppAuthenticationBuilderWithConfiguration AddMicrosoftIdentityWebAppAuthentication(this IServiceCollection services, IConfiguration configuration, string configSectionName = "AzureAd", string openIdConnectScheme = "OpenIdConnect", string cookieScheme = "Cookies", bool subscribeToOpenIdConnectMiddlewareDiagnosticsEvents = false, string? displayName = null)

Parameters

services IServiceCollection

Service collection to which to add authentication.

configuration IConfiguration

The IConfiguration object.

configSectionName string

The name of the configuration section with the necessary settings to initialize authentication options.

openIdConnectScheme string

Optional name for the open id connect authentication scheme (by default OpenIdConnectDefaults.AuthenticationScheme). This can be specified when you want to support several OpenIdConnect identity providers.

cookieScheme string

Optional name for the cookie authentication scheme (by default CookieAuthenticationDefaults.AuthenticationScheme).

subscribeToOpenIdConnectMiddlewareDiagnosticsEvents bool

Set to true if you want to debug, or just understand the OpenIdConnect events.

displayName string

A display name for the authentication handler.

Returns

MicrosoftIdentityWebAppAuthenticationBuilderWithConfiguration

The authentication builder to chain extension methods.