BearerTokenExtensions.AddBearerToken Method

Definition

Overloads

AddBearerToken(AuthenticationBuilder)

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

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

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)

Adds bearer token authentication.

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)

Source:
BearerTokenExtensions.cs

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

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

C#
public static Microsoft.AspNetCore.Authentication.AuthenticationBuilder AddBearerToken (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 ASP.NET Core 8.0
Product Versions
ASP.NET Core 8.0, 9.0

AddBearerToken(AuthenticationBuilder, Action<BearerTokenOptions>)

Source:
BearerTokenExtensions.cs

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

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

C#
public static Microsoft.AspNetCore.Authentication.AuthenticationBuilder AddBearerToken (this Microsoft.AspNetCore.Authentication.AuthenticationBuilder builder, Action<Microsoft.AspNetCore.Authentication.BearerToken.BearerTokenOptions> configure);

Parameters

configure
Action<BearerTokenOptions>

Action used to configure the bearer token authentication options.

Returns

A reference to builder after the operation has completed.

Applies to

ASP.NET Core 9.0 and ASP.NET Core 8.0
Product Versions
ASP.NET Core 8.0, 9.0

AddBearerToken(AuthenticationBuilder, String)

Source:
BearerTokenExtensions.cs

Adds bearer token authentication.

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

C#
public static Microsoft.AspNetCore.Authentication.AuthenticationBuilder AddBearerToken (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 ASP.NET Core 8.0
Product Versions
ASP.NET Core 8.0, 9.0

AddBearerToken(AuthenticationBuilder, String, Action<BearerTokenOptions>)

Source:
BearerTokenExtensions.cs

Adds bearer token authentication.

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

C#
public static Microsoft.AspNetCore.Authentication.AuthenticationBuilder AddBearerToken (this Microsoft.AspNetCore.Authentication.AuthenticationBuilder builder, string authenticationScheme, Action<Microsoft.AspNetCore.Authentication.BearerToken.BearerTokenOptions> configure);

Parameters

authenticationScheme
String

The authentication scheme.

configure
Action<BearerTokenOptions>

Action used to configure the bearer token authentication options.

Returns

A reference to builder after the operation has completed.

Applies to

ASP.NET Core 9.0 and ASP.NET Core 8.0
Product Versions
ASP.NET Core 8.0, 9.0