Class MicrosoftIdentityWebApiAuthenticationBuilderExtensions
Extensions for AuthenticationBuilder for startup initialization of web APIs.
public static class MicrosoftIdentityWebApiAuthenticationBuilderExtensions
- Inheritance
-
MicrosoftIdentityWebApiAuthenticationBuilderExtensions
- Inherited Members
Methods
AddMicrosoftIdentityWebApi(AuthenticationBuilder, IConfiguration, string, string, bool)
Protects the web API with Microsoft identity platform (formerly Azure AD v2.0). This method expects the configuration file will have a section, named "AzureAd" as default, with the necessary settings to initialize authentication options.
public static MicrosoftIdentityWebApiAuthenticationBuilderWithConfiguration AddMicrosoftIdentityWebApi(this AuthenticationBuilder builder, IConfiguration configuration, string configSectionName = "AzureAd", string jwtBearerScheme = "Bearer", bool subscribeToJwtBearerMiddlewareDiagnosticsEvents = false)
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.
jwtBearerScheme
stringThe JWT bearer scheme name to be used. By default it uses "Bearer".
subscribeToJwtBearerMiddlewareDiagnosticsEvents
boolSet to true if you want to debug, or just understand the JWT bearer events.
Returns
- MicrosoftIdentityWebApiAuthenticationBuilderWithConfiguration
The authentication builder to chain.
AddMicrosoftIdentityWebApi(AuthenticationBuilder, IConfigurationSection, string, bool)
Protects the web API with Microsoft identity platform (formerly Azure AD v2.0). This method expects the configuration file will have a section, named "AzureAd" as default, with the necessary settings to initialize authentication options.
public static MicrosoftIdentityWebApiAuthenticationBuilderWithConfiguration AddMicrosoftIdentityWebApi(this AuthenticationBuilder builder, IConfigurationSection configurationSection, string jwtBearerScheme = "Bearer", bool subscribeToJwtBearerMiddlewareDiagnosticsEvents = false)
Parameters
builder
AuthenticationBuilderThe AuthenticationBuilder to which to add this configuration.
configurationSection
IConfigurationSectionThe configuration second from which to fill-in the options.
jwtBearerScheme
stringThe JWT bearer scheme name to be used. By default it uses "Bearer".
subscribeToJwtBearerMiddlewareDiagnosticsEvents
boolSet to true if you want to debug, or just understand the JWT bearer events.
Returns
- MicrosoftIdentityWebApiAuthenticationBuilderWithConfiguration
The authentication builder to chain.
AddMicrosoftIdentityWebApi(AuthenticationBuilder, Action<JwtBearerOptions>, Action<MicrosoftIdentityOptions>, string, bool)
Protects the web API with Microsoft identity platform (formerly Azure AD v2.0).
public static MicrosoftIdentityWebApiAuthenticationBuilder AddMicrosoftIdentityWebApi(this AuthenticationBuilder builder, Action<JwtBearerOptions> configureJwtBearerOptions, Action<MicrosoftIdentityOptions> configureMicrosoftIdentityOptions, string jwtBearerScheme = "Bearer", bool subscribeToJwtBearerMiddlewareDiagnosticsEvents = false)
Parameters
builder
AuthenticationBuilderThe AuthenticationBuilder to which to add this configuration.
configureJwtBearerOptions
Action<JwtBearerOptions>The action to configure Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerOptions.
configureMicrosoftIdentityOptions
Action<MicrosoftIdentityOptions>The action to configure the Microsoft.Identity.Web.MicrosoftIdentityOptions.
jwtBearerScheme
stringThe JWT bearer scheme name to be used. By default it uses "Bearer".
subscribeToJwtBearerMiddlewareDiagnosticsEvents
boolSet to true if you want to debug, or just understand the JWT bearer events.
Returns
- MicrosoftIdentityWebApiAuthenticationBuilder
The authentication builder to chain.