Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The description of interaction of Authorize and AllowAnonymous attrbiutes could be improved. #33866

Open
voroninp opened this issue Oct 17, 2024 · 0 comments

Comments

@voroninp
Copy link
Contributor

voroninp commented Oct 17, 2024

Description

There's a note:

If you combine [AllowAnonymous] and an [Authorize] attribute, the [Authorize] attributes are ignored.

This is not completely true, and below you provide an indirect proof:

Authentication middleware is not short-circuited but doesn't need to succeed.

It's worth explicitly saying, that schemes specified in AuthenticationSchemes property of [Authorize] attribute will be used for authentication.

Page URL

https://learn.microsoft.com/en-us/aspnet/core/security/authorization/simple?view=aspnetcore-8.0#use-the-authorize-attribute

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/security/authorization/simple.md

Document ID

cea5942d-fb01-f5bf-3b63-25873d5b79cf

Article author

@Rick-Anderson

Related Issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant