-
Notifications
You must be signed in to change notification settings - Fork 227
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
Apply bearer auth to global scope is not working. #351
Comments
I'm seeing this as well. Both version 4.x and 5.0 are behaving this way for me. |
I suspect the issue is deeper down in the dependencies either swagger-jsdoc or @apidevtools/swagger-parser. Have to dig a bit deeper. For now am declaring the security: in each path spec |
The first code you posted is creating a global bearerAuth, but it is not telling that all routes will use this auth. To do that, you need to add a security property (as you do on each route) but on a global level. Exemple (code not tested, but it's something similar to the "Describing Bearer Authentication" part here) :
This will require all routes to have a bearerAuth. |
I'm trying to apply bearer auth to all operations and here's the implementation.
However, it doesn't work.
When I add security to an individual route operation, it works.
Anyone help me why global declaration is not working?
The text was updated successfully, but these errors were encountered: