Skip to content
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

jwt Authentication class compatibility with drf-spectacular #405

Closed
legitYosal opened this issue May 15, 2021 · 1 comment
Closed

jwt Authentication class compatibility with drf-spectacular #405

legitYosal opened this issue May 15, 2021 · 1 comment

Comments

@legitYosal
Copy link

there is a very strange behavior of drf-spectacular when defining Authentication classes from simple-jwt when you declare JWTAuthentication as default_authentication_class swagger UI authorize button works correctly but when you declare JWTTokenUserAuthentication as default_authentication_class swagger UI authorize button disappears and can not set Bearer token.
Steps to reproduce:
first, create a Django project with rest framework and drf-spectacular and simple jwt installed and configured with documentation guidance.
now go to /api/schema/swagger-ui/ everything works fine
then change authentication classes to:

    'DEFAULT_AUTHENTICATION_CLASSES': (
        # 'rest_framework_simplejwt.authentication.JWTAuthentication',
        'rest_framework_simplejwt.authentication.JWTTokenUserAuthentication',

    )

and refresh boom!! there is no authorize button at all!!! it looks like if you subclass JWTAuthentication class it goes wrong.
I did not know where to post this issue but so posted it on both, can anybody help me to fix drf-spectacular with this authentication class?
@tfranzel

@legitYosal
Copy link
Author

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

No branches or pull requests

1 participant