Back to Aspnetcore

Default Settings

aspnetcore/security/authentication/social/includes/default-settings.md

latest1.1 KB
Original Source
<!--Don't update this for 2.2, use the 2.2 version -->

The xref:Microsoft.Extensions.DependencyInjection.AuthenticationServiceCollectionExtensions.AddAuthentication(Microsoft.Extensions.DependencyInjection.IServiceCollection,System.String) overload sets the xref:Microsoft.AspNetCore.Authentication.AuthenticationOptions.DefaultScheme%2A property. The xref:Microsoft.Extensions.DependencyInjection.AuthenticationServiceCollectionExtensions.AddAuthentication(Microsoft.Extensions.DependencyInjection.IServiceCollection,System.Action{Microsoft.AspNetCore.Authentication.AuthenticationOptions}) overload allows configuring authentication options, which can be used to set up default authentication schemes for different purposes. Subsequent calls to AddAuthentication override previously configured xref:Microsoft.AspNetCore.Builder.AuthenticationOptions properties.

xref:Microsoft.AspNetCore.Authentication.AuthenticationBuilder extension methods that register an authentication handler may only be called once per authentication scheme. Overloads exist that allow configuring the scheme properties, scheme name, and display name.