jpadilla/django-rest-framework-jwt

JWT authentication is not working with latest version of Django RestFramework

RanaAsadFiaz opened this issue · 7 comments

JSON web token authorization lib is not working in the latest django rest framework and it is also defined in the official docs of it. I have searched many ways but for that i'll have to revert my version of django but that will crash my app because i am using latest features that were included in the django restframework. If you have any solution related to this then refer me instead of changing the version of python or django.

GetBlimp/django-rest-framework-jwt is abandoned and has been removed from DRF docs

I'm using it with the latest version of DRF and it works fine for me. What issue are you running into?

for me i run into the same issue

  • i have no apache in my setup
    -settings.py :
    REST_FRAMEWORK = {
    'DEFAULT_AUTHENTICATION_CLASSES': (
    'rest_framework_jwt.authentication.JSONWebTokenAuthentication',
    )
    }
    urls.py:
    path(r'api-token-auth/', obtain_jwt_token),
    path(r'api-token-verify/', verify_jwt_token),
    Screenshot from 2019-05-17 19-45-22

I'm not sure what exactly the problem is here. The way I make requests in Postman, which still works, is as follows: When making a request to the endpoint api-token-auth, add these two lines in the Tests tab in Postman:

var data = JSON.parse(responseBody);
postman.setEnvironmentVariable("Authorization", "JWT " + data.token);

Then create a global environment variable called Authorization that gets included with each request. Then you just need to refresh the token every so often when it expires.

Removal from DRF docs
encode/django-rest-framework#6138

Issue with django-rest-framework-jwt
encode/django-rest-framework#5838

https://github.com/Styria-Digital/django-rest-framework-jwt is a drop-in updated replacement fork with CI testing against recent Django and DRF

for me i run into the same issue

* i have no apache in my setup
  -settings.py :
  REST_FRAMEWORK = {
  'DEFAULT_AUTHENTICATION_CLASSES': (
  'rest_framework_jwt.authentication.JSONWebTokenAuthentication',
  )
  }
  urls.py:
  path(r'api-token-auth/', obtain_jwt_token),
  path(r'api-token-verify/', verify_jwt_token),
  ![Screenshot from 2019-05-17 19-45-22](https://user-images.githubusercontent.com/3405806/57946737-5b841880-78dd-11e9-83f8-ca7a62d50a8a.png)

I have also the same problem. Did you found any solution.