Class MicrosoftIdentityWebAppServiceCollectionExtensions
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
IServiceCollectionService collection to which to add authentication.
configuration
IConfigurationThe IConfiguration object.
configSectionName
stringThe name of the configuration section with the necessary settings to initialize authentication options.
openIdConnectScheme
stringOptional 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
stringOptional name for the cookie authentication scheme (by default CookieAuthenticationDefaults.AuthenticationScheme).
subscribeToOpenIdConnectMiddlewareDiagnosticsEvents
boolSet to true if you want to debug, or just understand the OpenIdConnect events.
displayName
stringA display name for the authentication handler.
Returns
- MicrosoftIdentityWebAppAuthenticationBuilderWithConfiguration
The authentication builder to chain extension methods.