Custom authentication backend does not get credentials

8 views
Skip to first unread message

Cristhiam Gabriel Fernández

unread,
Jul 16, 2019, 11:34:00 AM7/16/19
to Django users

Hi everyone

My project uses two authentications ways for different users. Administrator users authenticate themselves with username and password (ModelBackend). Customers authenticate themselves with phonenumber and token (custom authentication backend).
My custom backend authentication backend never gets the credentials. It only works if I use username and password.

class CustomerBackend:
 
def authenticate(self, request, phonenumber=None, token=None, **kwargs):
   
print(phone_number)
   
print(token)
   
print(kwargs)
   
return None

It shows:

None
None
{'phonenumber': '+17786432446', 'token': 'abc'}


Reply all
Reply to author
Forward
0 new messages