Skip to content

ShoudValidate for Antiforgery Tokens in Minimal APIs #63663

@ladeak

Description

@ladeak

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

Add multiple authentication providers configured. (ie. SAML+cookie and OAuth+JWT).
Add the built in Antiforgery CSRF protection.
Endpoints can accept requests using either authentication method.

For the Antiforgery token validator, I would like to have an easy way to configure when to run validation or not, so that I can disable it when the client uses a JWT token.

Describe the solution you'd like

An override option for the built in middleware or exposing a ShouldValidate() Func<> option in Add/UseAntiforgery methods.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions