I was trying to use swagger with flask as docs api
the problem i get now is that when the request sended use This header
Authorization: Bearer <jwt_token>
I get this error :
{
"description": "Unsupported authorization type",
"error": "Invalid JWT header",
"status_code": 401
}
when i use
Authorization: JWT <jwt_token>
All work great , so any good implementation to fix this with swagger and make it use JWT and not Bearer
Had the same issue, the solution is to use the headers as such
key: Authorization
value: jwt {token}
as simple as that.
I'm not sure about changing the swagger stuff, but if you are using flask-jwt-extended you can change the rest of your flask application to also use JWT instead of Bearer to keep everything consistent. See the JWT_HEADER_TYPE option here: http://flask-jwt-extended.readthedocs.io/en/latest/options.html#header-options
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With