JwtBearerExtensions.AddJwtBearer Method

Definition

Overloads

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.

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)

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, 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)

Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs

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.

C#
public static Microsoft.AspNetCore.Authentication.AuthenticationBuilder AddJwtBearer (this Microsoft.AspNetCore.Authentication.AuthenticationBuilder builder);

Parameters

Returns

A reference to builder after the operation has completed.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

AddJwtBearer(AuthenticationBuilder, Action<JwtBearerOptions>)

Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs

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.

C#
public static Microsoft.AspNetCore.Authentication.AuthenticationBuilder AddJwtBearer (this Microsoft.AspNetCore.Authentication.AuthenticationBuilder builder, Action<Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerOptions> configureOptions);

Parameters

configureOptions
Action<JwtBearerOptions>

A delegate that allows configuring JwtBearerOptions.

Returns

A reference to builder after the operation has completed.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

AddJwtBearer(AuthenticationBuilder, String)

Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs

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.

C#
public static Microsoft.AspNetCore.Authentication.AuthenticationBuilder AddJwtBearer (this Microsoft.AspNetCore.Authentication.AuthenticationBuilder builder, string authenticationScheme);

Parameters

authenticationScheme
String

The authentication scheme.

Returns

A reference to builder after the operation has completed.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 7.0, 8.0, 9.0

AddJwtBearer(AuthenticationBuilder, String, Action<JwtBearerOptions>)

Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs

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.

C#
public static Microsoft.AspNetCore.Authentication.AuthenticationBuilder AddJwtBearer (this Microsoft.AspNetCore.Authentication.AuthenticationBuilder builder, string authenticationScheme, Action<Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerOptions> configureOptions);

Parameters

authenticationScheme
String

The authentication scheme.

configureOptions
Action<JwtBearerOptions>

A delegate that allows configuring JwtBearerOptions.

Returns

A reference to builder after the operation has completed.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

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

Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs
Source:
JwtBearerExtensions.cs

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.

C#
public static Microsoft.AspNetCore.Authentication.AuthenticationBuilder AddJwtBearer (this Microsoft.AspNetCore.Authentication.AuthenticationBuilder builder, string authenticationScheme, string displayName, Action<Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerOptions> configureOptions);
C#
public static Microsoft.AspNetCore.Authentication.AuthenticationBuilder AddJwtBearer (this Microsoft.AspNetCore.Authentication.AuthenticationBuilder builder, string authenticationScheme, string? displayName, Action<Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerOptions> configureOptions);

Parameters

authenticationScheme
String

The authentication scheme.

displayName
String

The display name for the authentication handler.

configureOptions
Action<JwtBearerOptions>

A delegate that allows configuring JwtBearerOptions.

Returns

A reference to builder after the operation has completed.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0