ICsrfProtection.ValidateAsync(HttpContext) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.