Delen via


AuthenticationBuilder Class

Definition

Used to configure authentication

public ref class AuthenticationBuilder
public class AuthenticationBuilder
type AuthenticationBuilder = class
Public Class AuthenticationBuilder
Inheritance
AuthenticationBuilder

Constructors

AuthenticationBuilder(IServiceCollection)

Initializes a new instance of AuthenticationBuilder.

Properties

Services

The services being configured.

Methods

AddPolicyScheme(String, String, Action<PolicySchemeOptions>)

Adds a PolicySchemeHandler based authentication handler which can be used to redirect to other authentication schemes.

AddRemoteScheme<TOptions,THandler>(String, String, Action<TOptions>)

Adds a RemoteAuthenticationHandler<TOptions> based AuthenticationScheme that supports remote authentication which can be used by IAuthenticationService.

AddScheme<TOptions,THandler>(String, Action<TOptions>)

Adds a AuthenticationScheme which can be used by IAuthenticationService.

AddScheme<TOptions,THandler>(String, String, Action<TOptions>)

Adds a AuthenticationScheme which can be used by IAuthenticationService.

Extension Methods

AddIdentityServerJwt(AuthenticationBuilder)

Adds an authentication handler for an API that coexists with an Authorization Server.

AddAzureAD(AuthenticationBuilder, Action<AzureADOptions>)
Obsolete.

Adds Azure Active Directory Authentication to your application.

AddAzureAD(AuthenticationBuilder, String, String, String, String, Action<AzureADOptions>)
Obsolete.

Adds Azure Active Directory Authentication to your application.

AddAzureADBearer(AuthenticationBuilder, Action<AzureADOptions>)
Obsolete.

Adds JWT Bearer authentication to your app for Azure Active Directory Applications.

AddAzureADBearer(AuthenticationBuilder, String, String, Action<AzureADOptions>)
Obsolete.

Adds JWT Bearer authentication to your app for Azure Active Directory Applications.

AddAzureADB2C(AuthenticationBuilder, Action<AzureADB2COptions>)
Obsolete.

Adds Azure Active Directory B2C Authentication to your application.

AddAzureADB2C(AuthenticationBuilder, String, String, String, String, Action<AzureADB2COptions>)
Obsolete.

Adds Azure Active Directory B2C Authentication to your application.

AddAzureADB2CBearer(AuthenticationBuilder, Action<AzureADB2COptions>)
Obsolete.

Adds JWT Bearer authentication to your app for Azure AD B2C Applications.

AddAzureADB2CBearer(AuthenticationBuilder, String, String, Action<AzureADB2COptions>)
Obsolete.

Adds JWT Bearer authentication to your app for Azure AD B2C Applications.

AddApplicationCookie(AuthenticationBuilder)

Adds the identity application cookie.

AddExternalCookie(AuthenticationBuilder)

Adds the identity cookie used for external logins.

AddIdentityCookies(AuthenticationBuilder, Action<IdentityCookiesBuilder>)

Adds the cookie authentication needed for sign in manager.

AddIdentityCookies(AuthenticationBuilder)

Adds cookie authentication.

AddTwoFactorRememberMeCookie(AuthenticationBuilder)

Adds the identity cookie used for two factor remember me.

AddTwoFactorUserIdCookie(AuthenticationBuilder)

Adds the identity cookie used for two factor logins.

AddBearerToken(AuthenticationBuilder, Action<BearerTokenOptions>)

Adds bearer token authentication. The default scheme is specified by AuthenticationScheme.

Bearer tokens can be obtained by calling SignInAsync(HttpContext, String, ClaimsPrincipal).

AddBearerToken(AuthenticationBuilder, String, Action<BearerTokenOptions>)

Adds bearer token authentication.

Bearer tokens can be obtained by calling SignInAsync(HttpContext, String, ClaimsPrincipal).

AddBearerToken(AuthenticationBuilder, String)

Adds bearer token authentication.

Bearer tokens can be obtained by calling SignInAsync(HttpContext, String, ClaimsPrincipal).

AddBearerToken(AuthenticationBuilder)

Adds bearer token authentication. The default scheme is specified by AuthenticationScheme.

Bearer tokens can be obtained by calling SignInAsync(HttpContext, String, ClaimsPrincipal).

AddCertificate(AuthenticationBuilder, Action<CertificateAuthenticationOptions>)

Adds certificate authentication.

Certificate authentication uses a authentication handler that validates client certificate and raises an event where the certificate is resolved to a ClaimsPrincipal. See https://tools.ietf.org/html/rfc5246#section-7.4.4 to read more about certificate authentication.

AddCertificate(AuthenticationBuilder, String, Action<CertificateAuthenticationOptions>)

Adds certificate authentication.

Certificate authentication uses a authentication handler that validates client certificate and raises an event where the certificate is resolved to a ClaimsPrincipal. See https://tools.ietf.org/html/rfc5246#section-7.4.4 to read more about certificate authentication.

AddCertificate(AuthenticationBuilder, String)

Adds certificate authentication.

Certificate authentication uses a authentication handler that validates client certificate and raises an event where the certificate is resolved to a ClaimsPrincipal. See https://tools.ietf.org/html/rfc5246#section-7.4.4 to read more about certificate authentication.

AddCertificate(AuthenticationBuilder)

Adds certificate authentication.

Certificate authentication uses a authentication handler that validates client certificate and raises an event where the certificate is resolved to a ClaimsPrincipal. See https://tools.ietf.org/html/rfc5246#section-7.4.4 to read more about certificate authentication.

AddCertificateCache(AuthenticationBuilder, Action<CertificateValidationCacheOptions>)

Adds certificate authentication.

Certificate authentication uses a authentication handler that validates client certificate and raises an event where the certificate is resolved to a ClaimsPrincipal. See https://tools.ietf.org/html/rfc5246#section-7.4.4 to read more about certicate authentication.

AddCookie(AuthenticationBuilder, Action<CookieAuthenticationOptions>)

Adds cookie authentication to AuthenticationBuilder using the default scheme. The default scheme is specified by AuthenticationScheme.

Cookie authentication uses a HTTP cookie persisted in the client to perform authentication.

AddCookie(AuthenticationBuilder, String, Action<CookieAuthenticationOptions>)

Adds cookie authentication to AuthenticationBuilder using the specified scheme.

Cookie authentication uses a HTTP cookie persisted in the client to perform authentication.

AddCookie(AuthenticationBuilder, String, String, Action<CookieAuthenticationOptions>)

Adds cookie authentication to AuthenticationBuilder using the specified scheme.

Cookie authentication uses a HTTP cookie persisted in the client to perform authentication.

AddCookie(AuthenticationBuilder, String)

Adds cookie authentication to AuthenticationBuilder using the specified scheme.

Cookie authentication uses a HTTP cookie persisted in the client to perform authentication.

AddCookie(AuthenticationBuilder)

Adds cookie authentication to AuthenticationBuilder using the default scheme. The default scheme is specified by AuthenticationScheme.

Cookie authentication uses a HTTP cookie persisted in the client to perform authentication.

AddFacebook(AuthenticationBuilder, Action<FacebookOptions>)

Adds Facebook OAuth-based authentication to AuthenticationBuilder using the default scheme. The default scheme is specified by AuthenticationScheme.

Facebook authentication allows application users to sign in with their Facebook account.

AddFacebook(AuthenticationBuilder, String, Action<FacebookOptions>)

Adds Facebook OAuth-based authentication to AuthenticationBuilder using the default scheme. The default scheme is specified by AuthenticationScheme.

Facebook authentication allows application users to sign in with their Facebook account.

AddFacebook(AuthenticationBuilder, String, String, Action<FacebookOptions>)

Adds Facebook OAuth-based authentication to AuthenticationBuilder using the default scheme. The default scheme is specified by AuthenticationScheme.

Facebook authentication allows application users to sign in with their Facebook account.

AddFacebook(AuthenticationBuilder)

Adds Facebook OAuth-based authentication to AuthenticationBuilder using the default scheme. The default scheme is specified by AuthenticationScheme.

Facebook authentication allows application users to sign in with their Facebook account.

AddGoogle(AuthenticationBuilder, Action<GoogleOptions>)

Adds Google OAuth-based authentication to AuthenticationBuilder using the default scheme. The default scheme is specified by AuthenticationScheme.

Google authentication allows application users to sign in with their Google account.

AddGoogle(AuthenticationBuilder, String, Action<GoogleOptions>)

Adds Google OAuth-based authentication to AuthenticationBuilder using the default scheme. The default scheme is specified by AuthenticationScheme.

Google authentication allows application users to sign in with their Google account.

AddGoogle(AuthenticationBuilder, String, String, Action<GoogleOptions>)

Adds Google OAuth-based authentication to AuthenticationBuilder using the default scheme. The default scheme is specified by AuthenticationScheme.

Google authentication allows application users to sign in with their Google account.

AddGoogle(AuthenticationBuilder)

Adds Google OAuth-based authentication to AuthenticationBuilder using the default scheme. The default scheme is specified by AuthenticationScheme.

Google authentication allows application users to sign in with their Google account.

AddJwtBearer(AuthenticationBuilder, Action<JwtBearerOptions>)

Enables JWT-bearer authentication using the default scheme AuthenticationScheme.

JWT bearer authentication performs authentication by extracting and validating a JWT token from the Authorization request header.

AddJwtBearer(AuthenticationBuilder, String, Action<JwtBearerOptions>)

Enables JWT-bearer authentication using the specified scheme.

JWT bearer authentication performs authentication by extracting and validating a JWT token from the Authorization request header.

AddJwtBearer(AuthenticationBuilder, String, String, Action<JwtBearerOptions>)

Enables JWT-bearer authentication using the specified scheme.

JWT bearer authentication performs authentication by extracting and validating a JWT token from the Authorization request header.

AddJwtBearer(AuthenticationBuilder, String)

Enables JWT-bearer authentication using a pre-defined scheme.

JWT bearer authentication performs authentication by extracting and validating a JWT token from the Authorization request header.

AddJwtBearer(AuthenticationBuilder)

Enables JWT-bearer authentication using the default scheme AuthenticationScheme.

JWT bearer authentication performs authentication by extracting and validating a JWT token from the Authorization request header.

AddMicrosoftAccount(AuthenticationBuilder, Action<MicrosoftAccountOptions>)

Adds Microsoft Account OAuth-based authentication to AuthenticationBuilder using the default scheme. The default scheme is specified by AuthenticationScheme.

Microsoft Account authentication allows application users to sign in with their work, school, or personal Microsoft account.

AddMicrosoftAccount(AuthenticationBuilder, String, Action<MicrosoftAccountOptions>)

Adds Microsoft Account OAuth-based authentication to AuthenticationBuilder using the default scheme. The default scheme is specified by AuthenticationScheme.

Microsoft Account authentication allows application users to sign in with their work, school, or personal Microsoft account.

AddMicrosoftAccount(AuthenticationBuilder, String, String, Action<MicrosoftAccountOptions>)

Adds Microsoft Account OAuth-based authentication to AuthenticationBuilder using the default scheme. The default scheme is specified by AuthenticationScheme.

Microsoft Account authentication allows application users to sign in with their work, school, or personal Microsoft account.

AddMicrosoftAccount(AuthenticationBuilder)

Adds Microsoft Account OAuth-based authentication to AuthenticationBuilder using the default scheme. The default scheme is specified by AuthenticationScheme.

Microsoft Account authentication allows application users to sign in with their work, school, or personal Microsoft account.

AddNegotiate(AuthenticationBuilder, Action<NegotiateOptions>)

Configures the AuthenticationBuilder to use Negotiate (also known as Windows, Kerberos, or NTLM) authentication using the default scheme. The default scheme is specified by AuthenticationScheme.

This authentication handler supports Kerberos on Windows and Linux servers.

AddNegotiate(AuthenticationBuilder, String, Action<NegotiateOptions>)

Configures the AuthenticationBuilder to use Negotiate (also known as Windows, Kerberos, or NTLM) authentication using the specified authentication scheme.

This authentication handler supports Kerberos on Windows and Linux servers.

AddNegotiate(AuthenticationBuilder, String, String, Action<NegotiateOptions>)

Configures the AuthenticationBuilder to use Negotiate (also known as Windows, Kerberos, or NTLM) authentication using the specified authentication scheme.

This authentication handler supports Kerberos on Windows and Linux servers.

AddNegotiate(AuthenticationBuilder)

Configures the AuthenticationBuilder to use Negotiate (also known as Windows, Kerberos, or NTLM) authentication using the default scheme from AuthenticationScheme.

This authentication handler supports Kerberos on Windows and Linux servers.

AddOAuth(AuthenticationBuilder, String, Action<OAuthOptions>)

Adds OAuth 2.0 based authentication to AuthenticationBuilder using the specified authentication scheme.

AddOAuth(AuthenticationBuilder, String, String, Action<OAuthOptions>)

Adds OAuth 2.0 based authentication to AuthenticationBuilder using the specified authentication scheme.

AddOAuth<TOptions,THandler>(AuthenticationBuilder, String, Action<TOptions>)

Adds OAuth 2.0 based authentication to AuthenticationBuilder using the specified authentication scheme.

AddOAuth<TOptions,THandler>(AuthenticationBuilder, String, String, Action<TOptions>)

Adds OAuth 2.0 based authentication to AuthenticationBuilder using the specified authentication scheme.

AddOpenIdConnect(AuthenticationBuilder, Action<OpenIdConnectOptions>)

Adds OpenId Connect authentication to AuthenticationBuilder using the default scheme. The default scheme is specified by AuthenticationScheme.

OpenID Connect is an identity layer on top of the OAuth 2.0 protocol. It allows clients to request and receive information about authenticated sessions and end-users.

AddOpenIdConnect(AuthenticationBuilder, String, Action<OpenIdConnectOptions>)

Adds OpenId Connect authentication to AuthenticationBuilder using the specified scheme.

OpenID Connect is an identity layer on top of the OAuth 2.0 protocol. It allows clients to request and receive information about authenticated sessions and end-users.

AddOpenIdConnect(AuthenticationBuilder, String, String, Action<OpenIdConnectOptions>)

Adds OpenId Connect authentication to AuthenticationBuilder using the specified scheme.

OpenID Connect is an identity layer on top of the OAuth 2.0 protocol. It allows clients to request and receive information about authenticated sessions and end-users.

AddOpenIdConnect(AuthenticationBuilder)

Adds OpenId Connect authentication to AuthenticationBuilder using the default scheme. The default scheme is specified by AuthenticationScheme.

OpenID Connect is an identity layer on top of the OAuth 2.0 protocol. It allows clients to request and receive information about authenticated sessions and end-users.

AddTwitter(AuthenticationBuilder, Action<TwitterOptions>)

Adds Twitter OAuth-based authentication to AuthenticationBuilder using the default scheme. The default scheme is specified by AuthenticationScheme.

Twitter authentication allows application users to sign in with their Twitter account.

AddTwitter(AuthenticationBuilder, String, Action<TwitterOptions>)

Adds Twitter OAuth-based authentication to AuthenticationBuilder using the default scheme. The default scheme is specified by AuthenticationScheme.

Twitter authentication allows application users to sign in with their Twitter account.

AddTwitter(AuthenticationBuilder, String, String, Action<TwitterOptions>)

Adds Twitter OAuth-based authentication to AuthenticationBuilder using the default scheme. The default scheme is specified by AuthenticationScheme.

Twitter authentication allows application users to sign in with their Twitter account.

AddTwitter(AuthenticationBuilder)

Adds Twitter OAuth-based authentication to AuthenticationBuilder using the default scheme. The default scheme is specified by AuthenticationScheme.

Twitter authentication allows application users to sign in with their Twitter account.

AddWsFederation(AuthenticationBuilder, Action<WsFederationOptions>)

Registers the WsFederationHandler using the default authentication scheme, display name, and the given options configuration.

AddWsFederation(AuthenticationBuilder, String, Action<WsFederationOptions>)

Registers the WsFederationHandler using the given authentication scheme, default display name, and the given options configuration.

AddWsFederation(AuthenticationBuilder, String, String, Action<WsFederationOptions>)

Registers the WsFederationHandler using the given authentication scheme, display name, and options configuration.

AddWsFederation(AuthenticationBuilder)

Registers the WsFederationHandler using the default authentication scheme, display name, and options.

Applies to