jpadilla / django-rest-framework-jwt

JSON Web Token Authentication support for Django REST Framework
http://jpadilla.github.io/django-rest-framework-jwt/
MIT License
3.19k stars 651 forks source link

JWT authentication is not working with latest version of Django RestFramework #462

Open RanaAsadFiaz opened 5 years ago

RanaAsadFiaz commented 5 years ago

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.

mscansian commented 5 years ago

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

Alex3917 commented 5 years ago

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

faridos commented 5 years ago

for me i run into the same issue

Alex3917 commented 5 years ago

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.

mscansian commented 5 years ago

Removal from DRF docs https://github.com/encode/django-rest-framework/pull/6138

Issue with django-rest-framework-jwt https://github.com/encode/django-rest-framework/issues/5838

jayvdb commented 5 years ago

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

yashkundu commented 4 years ago

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.