-
Notifications
You must be signed in to change notification settings - Fork 601
How to integrate swagger with JWT? #757
Comments
2.2.0 is having issue to include token in header. I have same above config, working for 2.1.2 but not 2.2.0 |
Hello! After the new version of OpenAPI it should now be possible to speficy JWT authentification like this:
But if I do so I get a 'Unknown security definition type http' error. I would be very grateful if you could add those changes so that Django REST Swagger is compliant to the new OpenAPI 3.0 spec. |
It is bad and I used django-rest-swagger==2.1.2. Can you show me your configuration? Think you. |
Any update on this topic ? For people looking for a solution, my currently working setup for
2- As a value after clicking on the The UI is way better on the 2.2.0 so I can't wait for an update here. |
Thanks @JejeDurden it works perfectly fine! |
Is it possible to use django-rest-swagger with JSON web tokens?
I've perused the documentation and open issues and many people have examples using 'rest_framework.authentication.TokenAuthentication' in their DEFAULT_AUTHENTICATION_CLASSES but I have not seen any examples for 'rest_framework_jwt.authentication.JSONWebTokenAuthentication'.
Is this functionality part of the project or has this not been implemented yet?
For example this is what I am trying to achieve:
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework_jwt.authentication.JSONWebTokenAuthentication',
),
}
SWAGGER_SETTINGS = {
'SECURITY_DEFINITIONS': {
'basic': {'type': 'apiKey'},
'api_key': {
'type': 'apiKey',
'in': 'header',
'name': 'Authorization'
}
}
}
Also, I do not see the Authorization parameter in my requests with the above method, which seems to be noted by another user commenting on this issue: #708.
The text was updated successfully, but these errors were encountered: