JwtBearerOptions Class

Definition

Options class provides information needed to control Bearer Authentication middleware behavior

public class JwtBearerOptions : Microsoft.AspNetCore.Builder.AuthenticationOptions
Inheritance
JwtBearerOptions

Inherited Members

Microsoft.AspNetCore.Builder.AuthenticationOptions

Constructors

JwtBearerOptions()

Creates an instance of bearer authentication options with default values.

Properties

Audience

Gets or sets the audience for any received OpenIdConnect token.

Authority

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

BackchannelHttpHandler

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

BackchannelTimeout

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

Challenge

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

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

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

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

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 middleware from returning an error and an error_description in the WWW-Authenticate header.

MetadataAddress

Gets or sets the discovery endpoint for obtaining metadata

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

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

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

SecurityTokenValidators

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

SystemClock

For testing purposes only.

TokenValidationParameters

Gets or sets the parameters used to validate identity tokens.