Table of Contents

Class MicrosoftIdentityWebAppAuthenticationBuilderExtensions

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

Extensions for the AuthenticationBuilder for startup initialization.

public static class MicrosoftIdentityWebAppAuthenticationBuilderExtensions
Inheritance
MicrosoftIdentityWebAppAuthenticationBuilderExtensions
Inherited Members

Methods

AddMicrosoftIdentityWebApp(AuthenticationBuilder, IConfiguration, string, string, string?, bool, string?)

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

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

Parameters

builder AuthenticationBuilder

The AuthenticationBuilder to which to add this configuration.

configuration IConfiguration

The configuration instance.

configSectionName string

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

openIdConnectScheme string

The OpenID Connect scheme name to be used. By default it uses "OpenIdConnect".

cookieScheme string

The cookie-based scheme name to be used. By default it uses "Cookies".

subscribeToOpenIdConnectMiddlewareDiagnosticsEvents bool

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

displayName string

A display name for the authentication handler.

Returns

MicrosoftIdentityWebAppAuthenticationBuilderWithConfiguration

The MicrosoftIdentityWebAppAuthenticationBuilderWithConfiguration builder for chaining.

AddMicrosoftIdentityWebApp(AuthenticationBuilder, IConfigurationSection, string, string?, bool, string?)

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

public static MicrosoftIdentityWebAppAuthenticationBuilderWithConfiguration AddMicrosoftIdentityWebApp(this AuthenticationBuilder builder, IConfigurationSection configurationSection, string openIdConnectScheme = "OpenIdConnect", string? cookieScheme = "Cookies", bool subscribeToOpenIdConnectMiddlewareDiagnosticsEvents = false, string? displayName = null)

Parameters

builder AuthenticationBuilder

The AuthenticationBuilder to which to add this configuration.

configurationSection IConfigurationSection

The configuration section from which to get the options.

openIdConnectScheme string

The OpenID Connect scheme name to be used. By default it uses "OpenIdConnect".

cookieScheme string

The cookie-based scheme name to be used. By default it uses "Cookies".

subscribeToOpenIdConnectMiddlewareDiagnosticsEvents bool

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

displayName string

A display name for the authentication handler.

Returns

MicrosoftIdentityWebAppAuthenticationBuilderWithConfiguration

The authentication builder for chaining.

AddMicrosoftIdentityWebApp(AuthenticationBuilder, Action<MicrosoftIdentityOptions>, Action<CookieAuthenticationOptions>?, string, string?, bool, string?)

Add authentication with Microsoft identity platform.

public static MicrosoftIdentityWebAppAuthenticationBuilder AddMicrosoftIdentityWebApp(this AuthenticationBuilder builder, Action<MicrosoftIdentityOptions> configureMicrosoftIdentityOptions, Action<CookieAuthenticationOptions>? configureCookieAuthenticationOptions = null, string openIdConnectScheme = "OpenIdConnect", string? cookieScheme = "Cookies", bool subscribeToOpenIdConnectMiddlewareDiagnosticsEvents = false, string? displayName = null)

Parameters

builder AuthenticationBuilder

The AuthenticationBuilder to which to add this configuration.

configureMicrosoftIdentityOptions Action<MicrosoftIdentityOptions>

The action to configure Microsoft.Identity.Web.MicrosoftIdentityOptions.

configureCookieAuthenticationOptions Action<CookieAuthenticationOptions>

The action to configure CookieAuthenticationOptions.

openIdConnectScheme string

The OpenID Connect scheme name to be used. By default it uses "OpenIdConnect".

cookieScheme string

The cookie-based scheme name to be used. By default it uses "Cookies".

subscribeToOpenIdConnectMiddlewareDiagnosticsEvents bool

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

displayName string

A display name for the authentication handler.

Returns

MicrosoftIdentityWebAppAuthenticationBuilder

The authentication builder for chaining.