-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support other authentication backends #20
Comments
Yeah, I'm actually interested in using Knox myself– so I would be down for a PR that implements a way to swap that out. I don't understand your implementation though– in 1. did you mean a string that will get mapped to a function? Which existing call returns |
yeah, I meant the string will get mapped to a function. I'll try to whip up a PR in the next few days |
We're interested in the same, but we need it to add a refresh token in between. The only Django module I could find that does this is the Oauth Toolkit, so I guess I need a way to get drfpasswordless to ask oauth toolkit for a token (instead of the built-in Token directly). So, same issue, other use-case :) Would be cool if we can support a generic mechanism. |
Should be in 1.3.9+ |
Could anyone provide an example where using Knox Tokens? |
@aaronn I'm trying to integrate this with Knox, but after implementing my custom
Would you mind sharing how you were able to implement this with Knox? What is it that Knox needs to create for this to work? |
I'd like to use https://github.com/James1345/django-rest-knox instead of the built in
TokenAuthentication
backend. I'm fine using the existing system for the initial 6-digit codes, this change would only be for the final token generated after a successful callback.I have an idea about what this PR would look like and I think it's pretty small, but wanted to talk it out before spending time on implementation.
In particular, it looks like https://github.com/aaronn/django-rest-framework-passwordless/blob/master/drfpasswordless/views.py#L131 is the only place a 6-digit code gets turned into a token, so I'd like to abstract that out.
This would entail:
Adding a new setting
PASSWORDLESS_AUTH_TOKEN_CREATOR
which is a string that will get mapped to a string by the settings infrastructure. This function would take a user and return(string, bool)
matching the existing call. This would default to a function containing the current code.Update the call linked above to invoke whatever function is bound to
PASSWORDLESS_AUTH_TOKEN_CREATOR
.Does this sound good?
Thanks for a great project!
The text was updated successfully, but these errors were encountered: