JwtBearerOptions JwtBearerOptions JwtBearerOptions Class

Definition

Options class provides information needed to control Bearer Authentication handler behavior

public class JwtBearerOptions : Microsoft.AspNetCore.Authentication.AuthenticationSchemeOptions
type JwtBearerOptions = class
    inherit AuthenticationSchemeOptions
Public Class JwtBearerOptions
Inherits AuthenticationSchemeOptions
Inheritance

Constructors

JwtBearerOptions() JwtBearerOptions() JwtBearerOptions()

Properties

Audience Audience Audience

Gets or sets the audience for any received OpenIdConnect token.

Authority Authority Authority

Gets or sets the Authority to use when making OpenIdConnect calls.

BackchannelHttpHandler BackchannelHttpHandler BackchannelHttpHandler

The HttpMessageHandler used to retrieve metadata. This cannot be set at the same time as BackchannelCertificateValidator unless the value is a WebRequestHandler.

BackchannelTimeout BackchannelTimeout BackchannelTimeout

Gets or sets the timeout when using the backchannel to make an http call.

Challenge Challenge Challenge

Gets or sets the challenge to put in the "WWW-Authenticate" header.

ClaimsIssuer ClaimsIssuer ClaimsIssuer

Gets or sets the issuer that should be used for any claims that are created

(Inherited from AuthenticationSchemeOptions)
Configuration Configuration Configuration

Configuration provided directly by the developer. If provided, then MetadataAddress and the Backchannel properties will not be used. This information should not be updated during request processing.

ConfigurationManager ConfigurationManager ConfigurationManager

Responsible for retrieving, caching, and refreshing the configuration from metadata. If not provided, then one will be created using the MetadataAddress and Backchannel properties.

Events Events Events

The object provided by the application to process events raised by the bearer authentication handler. The application may implement the interface fully, or it may create an instance of JwtBearerEvents and assign delegates only to the events it wants to process.

EventsType EventsType EventsType

If set, will be used as the service type to get the Events instance instead of the property.

(Inherited from AuthenticationSchemeOptions)
ForwardAuthenticate ForwardAuthenticate ForwardAuthenticate

If set, this specifies the target scheme that this scheme should forward AuthenticateAsync calls to. For example Context.AuthenticateAsync("ThisScheme") => Context.AuthenticateAsync("ForwardAuthenticateValue"); Set the target to the current scheme to disable forwarding and allow normal processing.

(Inherited from AuthenticationSchemeOptions)
ForwardChallenge ForwardChallenge ForwardChallenge

If set, this specifies the target scheme that this scheme should forward ChallengeAsync calls to. For example Context.ChallengeAsync("ThisScheme") => Context.ChallengeAsync("ForwardChallengeValue"); Set the target to the current scheme to disable forwarding and allow normal processing.

(Inherited from AuthenticationSchemeOptions)
ForwardDefault ForwardDefault ForwardDefault

If set, this specifies a default scheme that authentication handlers should forward all authentication operations to by default. The default forwarding logic will check the most specific ForwardAuthenticate/Challenge/Forbid/SignIn/SignOut setting first, followed by checking the ForwardDefaultSelector, followed by ForwardDefault. The first non null result will be used as the target scheme to forward to.

(Inherited from AuthenticationSchemeOptions)
ForwardDefaultSelector ForwardDefaultSelector ForwardDefaultSelector

Used to select a default scheme for the current request that authentication handlers should forward all authentication operations to by default. The default forwarding logic will check the most specific ForwardAuthenticate/Challenge/Forbid/SignIn/SignOut setting first, followed by checking the ForwardDefaultSelector, followed by ForwardDefault. The first non null result will be used as the target scheme to forward to.

(Inherited from AuthenticationSchemeOptions)
ForwardForbid ForwardForbid ForwardForbid

If set, this specifies the target scheme that this scheme should forward ForbidAsync calls to. For example Context.ForbidAsync("ThisScheme") => Context.ForbidAsync("ForwardForbidValue"); Set the target to the current scheme to disable forwarding and allow normal processing.

(Inherited from AuthenticationSchemeOptions)
ForwardSignIn ForwardSignIn ForwardSignIn

If set, this specifies the target scheme that this scheme should forward SignInAsync calls to. For example Context.SignInAsync("ThisScheme") => Context.SignInAsync("ForwardSignInValue"); Set the target to the current scheme to disable forwarding and allow normal processing.

(Inherited from AuthenticationSchemeOptions)
ForwardSignOut ForwardSignOut ForwardSignOut

If set, this specifies the target scheme that this scheme should forward SignOutAsync calls to. For example Context.SignOutAsync("ThisScheme") => Context.SignInAsync("ForwardSignOutValue"); Set the target to the current scheme to disable forwarding and allow normal processing.

(Inherited from AuthenticationSchemeOptions)
IncludeErrorDetails IncludeErrorDetails IncludeErrorDetails

Defines whether the token validation errors should be returned to the caller. Enabled by default, this option can be disabled to prevent the JWT handler from returning an error and an error_description in the WWW-Authenticate header.

MetadataAddress MetadataAddress MetadataAddress

Gets or sets the discovery endpoint for obtaining metadata

RefreshOnIssuerKeyNotFound RefreshOnIssuerKeyNotFound RefreshOnIssuerKeyNotFound

Gets or sets if a metadata refresh should be attempted after a SecurityTokenSignatureKeyNotFoundException. This allows for automatic recovery in the event of a signature key rollover. This is enabled by default.

RequireHttpsMetadata RequireHttpsMetadata RequireHttpsMetadata

Gets or sets if HTTPS is required for the metadata address or authority. The default is true. This should be disabled only in development environments.

SaveToken SaveToken SaveToken

Defines whether the bearer token should be stored in the AuthenticationProperties after a successful authorization.

SecurityTokenValidators SecurityTokenValidators SecurityTokenValidators

Gets the ordered list of ISecurityTokenValidator used to validate access tokens.

TokenValidationParameters TokenValidationParameters TokenValidationParameters

Gets or sets the parameters used to validate identity tokens.

Methods

Validate() Validate() Validate()

Check that the options are valid. Should throw an exception if things are not ok.

(Inherited from AuthenticationSchemeOptions)
Validate(String) Validate(String) Validate(String)

Checks that the options are valid for a specific scheme

(Inherited from AuthenticationSchemeOptions)

Applies to