jpadilla / django-jwt-auth

JSON Web Token Authentication support for Django
MIT License
165 stars 46 forks source link

Login_required decorator and authentication backend #8

Open lmores opened 8 years ago

lmores commented 8 years ago

Hi, I've just discovered this extension of djangorestframework-jwt . I am wondering why the authentication is managed via JSONWebTokenAuthMixin and not using a custom authentication backend which would work fine with the @login_required decorator.

Thanks, Sirion

gregneagle commented 8 years ago

I would also like a way to use this with non-class-based views, as my existing application does not use Django class-based-views, and I'd rather not rewrite them all just to be able to use JWT. I'll poke at it and see if I can bend it to my will.

jpadilla commented 8 years ago

Pull requests are welcome

ivanguy commented 8 years ago

@jpadilla Authentication backend is implemented in GetBlimp/django-rest-framework-jwt am i wrong or same functionality can be achieved for this repository by (almost) just copying it?

jpadilla commented 8 years ago

@ivanguy yup you're right.

AndreaCrotti commented 8 years ago

+1 about this, but even more importantly it should be mentioned in the README that this is the Mixin is actually the way to protect a view, right?

I was trying to understand how I was supposed to actually protect a view and it was really not that clear..

thanks!