Class MicrosoftIdentityWebAppAuthenticationBuilderExtensions
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
AuthenticationBuilderThe AuthenticationBuilder to which to add this configuration.
configuration
IConfigurationThe configuration instance.
configSectionName
stringThe configuration section with the necessary settings to initialize authentication options.
openIdConnectScheme
stringThe OpenID Connect scheme name to be used. By default it uses "OpenIdConnect".
cookieScheme
stringThe cookie-based scheme name to be used. By default it uses "Cookies".
subscribeToOpenIdConnectMiddlewareDiagnosticsEvents
boolSet to true if you want to debug, or just understand the OpenID Connect events.
displayName
stringA 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
AuthenticationBuilderThe AuthenticationBuilder to which to add this configuration.
configurationSection
IConfigurationSectionThe configuration section from which to get the options.
openIdConnectScheme
stringThe OpenID Connect scheme name to be used. By default it uses "OpenIdConnect".
cookieScheme
stringThe cookie-based scheme name to be used. By default it uses "Cookies".
subscribeToOpenIdConnectMiddlewareDiagnosticsEvents
boolSet to true if you want to debug, or just understand the OpenID Connect events.
displayName
stringA 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
AuthenticationBuilderThe 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
stringThe OpenID Connect scheme name to be used. By default it uses "OpenIdConnect".
cookieScheme
stringThe cookie-based scheme name to be used. By default it uses "Cookies".
subscribeToOpenIdConnectMiddlewareDiagnosticsEvents
boolSet to true if you want to debug, or just understand the OpenID Connect events.
displayName
stringA display name for the authentication handler.
Returns
- MicrosoftIdentityWebAppAuthenticationBuilder
The authentication builder for chaining.