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

django-rest-knox compatibility

Open stantond opened this issue 7 years ago • 10 comments

Knox provides more security and more functionality than the standard DRF TokenAuthentication. This PR adds full support for Knox.

The development branch seems somewhat behind, so I've raised this against master, but the tests need a little work. I've hit a wall and would really appreciate some help.

I'm not convinced the Knox tests are using knox.auth.TokenAuthentication as expected, and I cannot write a working test_logout_knox. Everything works as expected during manual testing.

Closes #305

stantond avatar Jan 26 '17 19:01 stantond

Hi :) What is the status of this PR? It would be nice to have this Knox compatibility merged in. I am available to help with anything if need be :)

jasrusable avatar May 27 '17 13:05 jasrusable

That'd be great. Functionally, it's all there - my E2E testing went fine. I had trouble getting unit testing to work, then ran out of time to work on this, so it's in need of some test mastery

stantond avatar May 27 '17 13:05 stantond

@stantond Thank you for this PR. It helped me to add knox to my project with django rest auth.

Actually, to use knox token with django rest auth we need to redefine LoginView, RegisterView. And write create_token and serializer for knox token. So instead of merging this we can just write an instuction of how to achieve this.

AndrewPix avatar Sep 17 '17 16:09 AndrewPix

Glad it helped!

I used the code, you used the code, other people would have too, so it'll save people time in future to merge it and keep usage easy, or put the required classes in another repo. Otherwise we're just telling people to redo work we've already done!

stantond avatar Sep 18 '17 10:09 stantond

I would like to see this merged. The default DFT token authentication is rather terrible compared to Knox.

chdsbd avatar Jan 17 '18 07:01 chdsbd

What's the status of this PR? Will it merge?

mubaris avatar Mar 04 '18 07:03 mubaris

So is there any chance that this will get merged? Knox is quite nice and nifty, and the current of compatibility in the main branch is rather disappointing.

ksitko avatar Dec 14 '18 05:12 ksitko

This would be nice to have

artemistomaras avatar Jun 19 '19 10:06 artemistomaras

seems like there's enough interest to get this merged...

colin-byrne-1 avatar Jul 10 '19 02:07 colin-byrne-1

Hi @stantond, I consider your PR especially important, since we should really expect a user to get logged out from a single session only, on logout.

As a user of rest-auth, thanks for the contribution!

Unfortunately, this repo is not maintained anymore, Tivix does not seem to respond at all, so the development moved to dj-rest-auth. (reference: https://github.com/Tivix/django-rest-auth/issues/568) Can you please move this PR there? (and upgrade to using dj_rest_auth) I also let the other PR-s know about this, so I expect/hope lots of updates are coming soon in dj_rest_auth, that didn't get merged here.

new repo link: https://github.com/jazzband/dj-rest-auth (I'm not the upkeeper of that repo, it just makes sense for me to help you merge your PR)

Many Thanks, Barney

BarnabasSzabolcs avatar May 30 '20 01:05 BarnabasSzabolcs