AuthenticationHttpContextExtensions.AuthenticateAsync Method

Definition

Overloads

AuthenticateAsync(HttpContext)

Authenticate the current request using the default authentication scheme. The default authentication scheme can be configured using DefaultAuthenticateScheme.

AuthenticateAsync(HttpContext, String)

Authenticate the current request using the specified scheme.

AuthenticateAsync(HttpContext)

Source:
AuthenticationHttpContextExtensions.cs
Source:
AuthenticationHttpContextExtensions.cs
Source:
AuthenticationHttpContextExtensions.cs

Authenticate the current request using the default authentication scheme. The default authentication scheme can be configured using DefaultAuthenticateScheme.

C#
public static System.Threading.Tasks.Task<Microsoft.AspNetCore.Authentication.AuthenticateResult> AuthenticateAsync (this Microsoft.AspNetCore.Http.HttpContext context);

Parameters

context
HttpContext

The HttpContext context.

Returns

The AuthenticateResult.

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

AuthenticateAsync(HttpContext, String)

Source:
AuthenticationHttpContextExtensions.cs
Source:
AuthenticationHttpContextExtensions.cs
Source:
AuthenticationHttpContextExtensions.cs

Authenticate the current request using the specified scheme.

C#
public static System.Threading.Tasks.Task<Microsoft.AspNetCore.Authentication.AuthenticateResult> AuthenticateAsync (this Microsoft.AspNetCore.Http.HttpContext context, string scheme);
C#
public static System.Threading.Tasks.Task<Microsoft.AspNetCore.Authentication.AuthenticateResult> AuthenticateAsync (this Microsoft.AspNetCore.Http.HttpContext context, string? scheme);

Parameters

context
HttpContext

The HttpContext context.

scheme
String

The name of the authentication scheme.

Returns

The AuthenticateResult.

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