opened
Kizmar
username_0
Using: Swashbuckle.AspNetCore Version 4.0.1

I recently updated our Swashbuckle implementation and added an oauth2 scheme with an operation filter. Now when I use Swagger-UI, the endpoints that have an `[Authorize]` attribute show a lock icon in Swagger-UI, and it adds the bearer token to the request headers.

I just noticed that the lock icon and header aren't getting added when we apply a global `AuthorizeFilter` and aren't using `[Authorize]` within the controllers. 

Example:
```
services.AddMvc(config =>
{
    var policy = new AuthorizationPolicyBuilder()
        .RequireAuthenticatedUser()
        .Build();

    config.Filters.Add(new AuthorizeFilter(policy));
}
```

I'm not sure if this is a bug, or if my configuration needs to be adjusted for this scenario. I can post more code here if needed, just not sure what would be needed for this.
Global AuthorizeFilter not picked up as [Authorize]
issue
created
lonix1
username_1
I posted something similar [here](https://github.com/mattfrear/Swashbuckle.AspNetCore.Filters/issues/93). It's probably easier to get the feature into that library.

If you aren't using that library by the way, it's quite awesome.
comment
closed
domaindrivendev
username_2
issue
created
domaindrivendev
username_2
Swashbuckle doesn't provide any automatic integration with the `Authorize` attributes or global filters. The recommended approach is to implement this yourself with an operation filter. I would imagine your filter needs to be updated to account for globally configured attributes but this isn't really a Swashbuckle issue.
comment