aalili
4 years agoOccasional Visitor
Executing API endpoint with Authorization from Swagger UI throws error 401
Hi,
I am having trouble executing endpoint from Swagger UI with bearer authorization.
I am using OpenAPI 3.0 specification and I define securitySchemes as
"securitySchemes": {
"bearerAuth": {
"type": "http",
"scheme": "bearer"
}
}
And then append bearerAuth for all endpoints as
"security": [{
"bearerAuth": []
}]
Authorize button is shown on Swagger UI and I can fill the token, when I run the request I see 401 error on network, but, the curl is created correctly with the Authorization header and the right value. When I copy-paste that curl into my terminal, it works good.
Anyone faced similar issue?