You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 26, 2020. It is now read-only.
I am writing a backend api using django rest-framework. I would like jwt authentication using email or username interchangeably (one or other) and password instead of using username and password.
Is there any way using your djangorestframework-jwt package?
Thanks in advance.
Xavier Monfort Faure
The text was updated successfully, but these errors were encountered:
@xmonfort There are a couple of ways, you could write your own serializer based off JSONWebTokenSerializer. It currently uses your User's model USERNAME_FIELD, which by default is username. It uses your authentication backend to authenticate your user based on that field and password. You could use the default serializer implementation and probably just have a a custom authentication backend that checks if the username looks like an email and try to find a user that way.
I need to add an additional field in JSONWebTokenSerializer so i can use it in authenticate() function, but i don't know how to extend and implement it, is there any reference to do it.
I am writing a backend api using django rest-framework. I would like jwt authentication using email or username interchangeably (one or other) and password instead of using username and password.
Is there any way using your djangorestframework-jwt package?
Thanks in advance.
Xavier Monfort Faure
The text was updated successfully, but these errors were encountered: