AuthenticationServiceCollectionExtensions.AddScheme Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
AddScheme<TOptions,THandler>(IServiceCollection, String, Action<TOptions>)
Caution
AddScheme is obsolete. Use AddAuthentication().AddScheme instead.
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddScheme<TOptions,THandler> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string authenticationScheme, Action<TOptions> configureOptions) where TOptions : Microsoft.AspNetCore.Authentication.AuthenticationSchemeOptions, new() where THandler : Microsoft.AspNetCore.Authentication.AuthenticationHandler<TOptions>;
[System.Obsolete("AddScheme is obsolete. Use AddAuthentication().AddScheme instead.")]
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddScheme<TOptions,THandler> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string authenticationScheme, Action<TOptions> configureOptions) where TOptions : Microsoft.AspNetCore.Authentication.AuthenticationSchemeOptions, new() where THandler : Microsoft.AspNetCore.Authentication.AuthenticationHandler<TOptions>;
static member AddScheme : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * Action<'Options (requires 'Options :> Microsoft.AspNetCore.Authentication.AuthenticationSchemeOptions and 'Options : (new : unit -> 'Options))> -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Options :> Microsoft.AspNetCore.Authentication.AuthenticationSchemeOptions and 'Options : (new : unit -> 'Options) and 'Handler :> Microsoft.AspNetCore.Authentication.AuthenticationHandler<'Options>)
[<System.Obsolete("AddScheme is obsolete. Use AddAuthentication().AddScheme instead.")>]
static member AddScheme : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * Action<'Options (requires 'Options :> Microsoft.AspNetCore.Authentication.AuthenticationSchemeOptions and 'Options : (new : unit -> 'Options))> -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Options :> Microsoft.AspNetCore.Authentication.AuthenticationSchemeOptions and 'Options : (new : unit -> 'Options) and 'Handler :> Microsoft.AspNetCore.Authentication.AuthenticationHandler<'Options>)
<Extension()>
Public Function AddScheme(Of TOptions As {AuthenticationSchemeOptionsNew}, THandler As {AuthenticationSchemeOptionsNew}) (services As IServiceCollection, authenticationScheme As String, configureOptions As Action(Of TOptions)) As IServiceCollection
Type Parameters
- TOptions
- THandler
Parameters
- services
- IServiceCollection
- authenticationScheme
- String
- configureOptions
- Action<TOptions>
Returns
- Attributes
Applies to
AddScheme<TOptions,THandler>(IServiceCollection, String, String, Action<TOptions>)
Caution
AddScheme is obsolete. Use AddAuthentication().AddScheme instead.
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddScheme<TOptions,THandler> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string authenticationScheme, string displayName, Action<TOptions> configureOptions) where TOptions : Microsoft.AspNetCore.Authentication.AuthenticationSchemeOptions, new() where THandler : Microsoft.AspNetCore.Authentication.AuthenticationHandler<TOptions>;
[System.Obsolete("AddScheme is obsolete. Use AddAuthentication().AddScheme instead.")]
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddScheme<TOptions,THandler> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string authenticationScheme, string displayName, Action<TOptions> configureOptions) where TOptions : Microsoft.AspNetCore.Authentication.AuthenticationSchemeOptions, new() where THandler : Microsoft.AspNetCore.Authentication.AuthenticationHandler<TOptions>;
static member AddScheme : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * string * Action<'Options (requires 'Options :> Microsoft.AspNetCore.Authentication.AuthenticationSchemeOptions and 'Options : (new : unit -> 'Options))> -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Options :> Microsoft.AspNetCore.Authentication.AuthenticationSchemeOptions and 'Options : (new : unit -> 'Options) and 'Handler :> Microsoft.AspNetCore.Authentication.AuthenticationHandler<'Options>)
[<System.Obsolete("AddScheme is obsolete. Use AddAuthentication().AddScheme instead.")>]
static member AddScheme : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * string * Action<'Options (requires 'Options :> Microsoft.AspNetCore.Authentication.AuthenticationSchemeOptions and 'Options : (new : unit -> 'Options))> -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Options :> Microsoft.AspNetCore.Authentication.AuthenticationSchemeOptions and 'Options : (new : unit -> 'Options) and 'Handler :> Microsoft.AspNetCore.Authentication.AuthenticationHandler<'Options>)
<Extension()>
Public Function AddScheme(Of TOptions As {AuthenticationSchemeOptionsNew}, THandler As {AuthenticationSchemeOptionsNew}) (services As IServiceCollection, authenticationScheme As String, displayName As String, configureOptions As Action(Of TOptions)) As IServiceCollection
Type Parameters
- TOptions
- THandler
Parameters
- services
- IServiceCollection
- authenticationScheme
- String
- displayName
- String
- configureOptions
- Action<TOptions>
Returns
- Attributes
Applies to
AddScheme<TOptions,THandler>(IServiceCollection, String, String, Action<AuthenticationSchemeBuilder>, Action<TOptions>)
Caution
AddScheme is obsolete. Use AddAuthentication().AddScheme instead.
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddScheme<TOptions,THandler> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string authenticationScheme, string displayName, Action<Microsoft.AspNetCore.Authentication.AuthenticationSchemeBuilder> configureScheme, Action<TOptions> configureOptions) where TOptions : Microsoft.AspNetCore.Authentication.AuthenticationSchemeOptions, new() where THandler : Microsoft.AspNetCore.Authentication.AuthenticationHandler<TOptions>;
[System.Obsolete("AddScheme is obsolete. Use AddAuthentication().AddScheme instead.")]
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddScheme<TOptions,THandler> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string authenticationScheme, string displayName, Action<Microsoft.AspNetCore.Authentication.AuthenticationSchemeBuilder> configureScheme, Action<TOptions> configureOptions) where TOptions : Microsoft.AspNetCore.Authentication.AuthenticationSchemeOptions, new() where THandler : Microsoft.AspNetCore.Authentication.AuthenticationHandler<TOptions>;
static member AddScheme : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * string * Action<Microsoft.AspNetCore.Authentication.AuthenticationSchemeBuilder> * Action<'Options (requires 'Options :> Microsoft.AspNetCore.Authentication.AuthenticationSchemeOptions and 'Options : (new : unit -> 'Options))> -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Options :> Microsoft.AspNetCore.Authentication.AuthenticationSchemeOptions and 'Options : (new : unit -> 'Options) and 'Handler :> Microsoft.AspNetCore.Authentication.AuthenticationHandler<'Options>)
[<System.Obsolete("AddScheme is obsolete. Use AddAuthentication().AddScheme instead.")>]
static member AddScheme : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * string * Action<Microsoft.AspNetCore.Authentication.AuthenticationSchemeBuilder> * Action<'Options (requires 'Options :> Microsoft.AspNetCore.Authentication.AuthenticationSchemeOptions and 'Options : (new : unit -> 'Options))> -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Options :> Microsoft.AspNetCore.Authentication.AuthenticationSchemeOptions and 'Options : (new : unit -> 'Options) and 'Handler :> Microsoft.AspNetCore.Authentication.AuthenticationHandler<'Options>)
<Extension()>
Public Function AddScheme(Of TOptions As {AuthenticationSchemeOptionsNew}, THandler As {AuthenticationSchemeOptionsNew}) (services As IServiceCollection, authenticationScheme As String, displayName As String, configureScheme As Action(Of AuthenticationSchemeBuilder), configureOptions As Action(Of TOptions)) As IServiceCollection
Type Parameters
- TOptions
- THandler
Parameters
- services
- IServiceCollection
- authenticationScheme
- String
- displayName
- String
- configureScheme
- Action<AuthenticationSchemeBuilder>
- configureOptions
- Action<TOptions>
Returns
- Attributes
Applies to
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for