1 implementation of IAntiforgery
Microsoft.AspNetCore.Antiforgery (1)
Internal\DefaultAntiforgery.cs (1)
17internal sealed class DefaultAntiforgery : IAntiforgery
25 references to IAntiforgery
Microsoft.AspNetCore.Antiforgery (10)
AntiforgeryApplicationBuilderExtensions.cs (4)
27/// <see cref="IAntiforgery"/> and call <see cref="IAntiforgery.ValidateRequestAsync(HttpContext)"/> or 28/// <see cref="IAntiforgery.IsRequestValidAsync(HttpContext)"/> in your handler. 52if (builder.ApplicationServices.GetService(typeof(IAntiforgery)) == null)
AntiforgeryMiddleware.cs (2)
8internal sealed class AntiforgeryMiddleware(IAntiforgery antiforgery, RequestDelegate next) 11private readonly IAntiforgery _antiforgery = antiforgery;
AntiforgeryServiceCollectionExtensions.cs (1)
30services.TryAddSingleton<IAntiforgery, DefaultAntiforgery>();
RequireAntiforgeryTokenAttribute.cs (3)
19/// If you need validation for other HTTP methods, resolve <see cref="IAntiforgery"/> and call 20/// <see cref="IAntiforgery.ValidateRequestAsync(HttpContext)"/> or 21/// <see cref="IAntiforgery.IsRequestValidAsync(HttpContext)"/> in your handler.
Microsoft.AspNetCore.Components.Endpoints (4)
Forms\EndpointAntiforgeryStateProvider.cs (1)
10internal class EndpointAntiforgeryStateProvider(IAntiforgery antiforgery) : DefaultAntiforgeryStateProvider()
RazorComponentEndpointInvoker.cs (3)
72var antiforgery = context.RequestServices.GetRequiredService<IAntiforgery>(); 200private async Task<RequestValidationState> ValidateRequestAsync(HttpContext context, IAntiforgery? antiforgery)
Microsoft.AspNetCore.Mvc.Razor (2)
RazorPageBase.cs (2)
716var antiforgery = viewContext.HttpContext.RequestServices.GetRequiredService<IAntiforgery>();
Microsoft.AspNetCore.Mvc.ViewFeatures (9)
AntiforgeryExtensions.cs (3)
14/// Static class that adds extension methods to <see cref="IAntiforgery"/>. This class cannot be inherited. 21/// <param name="antiforgery">The <see cref="IAntiforgery"/> instance.</param> 31public static IHtmlContent GetHtml(this IAntiforgery antiforgery, HttpContext httpContext)
DefaultHtmlGenerator.cs (3)
38private readonly IAntiforgery _antiforgery; 48/// <param name="antiforgery">The <see cref="IAntiforgery"/> instance which is used to generate antiforgery 56IAntiforgery antiforgery,
Filters\AutoValidateAntiforgeryTokenAuthorizationFilter.cs (1)
13public AutoValidateAntiforgeryTokenAuthorizationFilter(IAntiforgery antiforgery, ILoggerFactory loggerFactory)
Filters\ValidateAntiforgeryTokenAuthorizationFilter.cs (2)
12private readonly IAntiforgery _antiforgery; 15public ValidateAntiforgeryTokenAuthorizationFilter(IAntiforgery antiforgery, ILoggerFactory loggerFactory)