Bearer token is not used by Swagger for endpoints with [authorize], but used for [AllowAnonymous]
Hey!
Yesterday while working on a project for university I encountered a strange bug, which can be seen in the screens below:
Yesterday while working on a project for university I encountered a strange bug, which can be seen in the screens below:
- When an endpoint is marked with the
[Authorize]attribute, even if a Bearer Token is specified in Swagger, this Token will not be used in the execution of the request. - If we use the
[AllowAnonymous]attribute instead of[Authorize], the Bearer Token will be sent in the request.




