Language

ICsrfProtection.ValidateAsync(HttpContext) Method

Definition

Validates whether the request should be allowed based on its origin.

public System.Threading.Tasks.ValueTask<Microsoft.AspNetCore.Antiforgery.CsrfProtectionResult> ValidateAsync(Microsoft.AspNetCore.Http.HttpContext context);
abstract member ValidateAsync : Microsoft.AspNetCore.Http.HttpContext -> System.Threading.Tasks.ValueTask<Microsoft.AspNetCore.Antiforgery.CsrfProtectionResult>
Public Function ValidateAsync (context As HttpContext) As ValueTask(Of CsrfProtectionResult)

Parameters

context
HttpContext

The HttpContext associated with the current request.

Returns

A ValueTask<TResult> that resolves to a CsrfProtectionResult whose IsAllowed is true when the request is same-origin, from a trusted origin, uses a safe HTTP method, or originates from a non-browser client; otherwise false.

Applies to