Skip to content
This repository has been archived by the owner on Jan 11, 2021. It is now read-only.

Django JWT authentication does not load all the protected urls #807

Open
ihd2911 opened this issue Jul 12, 2019 · 2 comments
Open

Django JWT authentication does not load all the protected urls #807

ihd2911 opened this issue Jul 12, 2019 · 2 comments

Comments

@ihd2911
Copy link

ihd2911 commented Jul 12, 2019

Following is my code in settings.py

SWAGGER_SETTINGS = {
     'LOGIN_URL': 'api:login',
     'LOGOUT_URL': 'api:logout',
     'USE_SESSION_AUTH': False,
     'DOC_EXPANSION': 'list',
     'APIS_SORTER': 'alpha',
     'SECURITY_DEFINITIONS': {
         'api_key': {
             'type': 'apiKey',
             'in': 'header',
             'name': 'Authorization',
             "description": "JWT authorization"
         }
     },
 }
'DEFAULT_AUTHENTICATION_CLASSES': [
    'rest_framework_jwt.authentication.JSONWebTokenAuthentication',
],

# Permission settings
'DEFAULT_PERMISSION_CLASSES': [
    'rest_framework.permissions.IsAuthenticated',
],

When i login using my api in the swagger and fill in the information in the Authorize button pop up, my api list which is protected still does not appear.

I tried adding it as 'Bearer token', but it do not work.

@ihd2911
Copy link
Author

ihd2911 commented Jul 15, 2019

To clarify this issue is in version 2.2.0 and works in swagger 2.1.2

@ghost
Copy link

ghost commented Jul 30, 2019

This is a duplicated issue of #759

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant