django-jwt-auth icon indicating copy to clipboard operation
django-jwt-auth copied to clipboard

Login_required decorator and authentication backend

Open lmores opened this issue 9 years ago • 5 comments

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

lmores avatar Feb 13 '16 19:02 lmores

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.

gregneagle avatar Mar 09 '16 15:03 gregneagle

Pull requests are welcome

jpadilla avatar Mar 16 '16 21:03 jpadilla

@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?

ivanguy avatar Apr 08 '16 22:04 ivanguy

@ivanguy yup you're right.

jpadilla avatar Apr 09 '16 12:04 jpadilla

+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!

AndreaCrotti avatar Jun 01 '16 13:06 AndreaCrotti