Skip to main content
All docs
V25.1
  • .NET 8.0+
    • The page you are viewing does not exist in the .NET Framework 4.6.2+ platform documentation. This link will take you to the parent topic of the current section.

    BlazorSecurityBuilderExtensions.ConfigureAntiforgery(IBlazorSecurityBuilder, Action<AntiforgeryValidationOptions>) Method

    Namespace: DevExpress.ExpressApp.ApplicationBuilder

    Assembly: DevExpress.ExpressApp.Blazor.v25.1.dll

    NuGet Package: DevExpress.ExpressApp.Blazor

    Declaration

    public static IBlazorSecurityBuilder ConfigureAntiforgery(
        this IBlazorSecurityBuilder builder,
        Action<AntiforgeryValidationOptions> configureOptions
    )

    Parameters

    Name Type
    builder IBlazorSecurityBuilder
    configureOptions Action<DevExpress.ExpressApp.Security.AntiforgeryValidationOptions>

    Returns

    Type
    IBlazorSecurityBuilder

    Remarks

    Important

    The Antiforgery mechanism in Web API apps with Windows authentication can result in error 400. You can use the AntiforgeryOptions.ExcludeAuthenticationSchemes property to disable antiforgery for Windows authentication:

    builder.Security
        .UseIntegratedMode(options => {...})
        .ConfigureAntiforgery(opt => {
            opt.ExcludeAuthenticationSchemes.Add("NTLM"); // for Kestrel
            opt.ExcludeAuthenticationSchemes.Add("Negotiate"); // for IIS
        });
    
    See Also