Skip to content
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

XMLRPC Auth.login does not work with django.contrib.auth.backends.ModelBackend #498

Closed
tash opened this issue Jan 20, 2020 · 3 comments · Fixed by #777
Closed

XMLRPC Auth.login does not work with django.contrib.auth.backends.ModelBackend #498

tash opened this issue Jan 20, 2020 · 3 comments · Fixed by #777
Milestone

Comments

@tash
Copy link

tash commented Jan 20, 2020

Calls to Auth.login always return with ''Wrong username or password'' when django.contriub.auth.backends.ModelBackend is used.

user = backend.authenticate(*check_user_name(credential))

This call is wrong, as it takes a request object as first object: https://docs.djangoproject.com/en/3.0/ref/contrib/auth/#django.contrib.auth.backends.ModelBackend.authenticate

Possible fix based on the django documentation

request is an HttpRequest and may be None if it wasn’t provided to authenticate() (which passes it on to the backend).

user = backend.authenticate(None, *check_user_name(credential))

@tash tash changed the title XMLRPC Auth.login does not work with django.contriub.auth.backends.ModelBackend XMLRPC Auth.login does not work with django.contrib.auth.backends.ModelBackend Jan 20, 2020
@tash
Copy link
Author

tash commented Jan 20, 2020

The request argument was added in Django 1.11. This bug should be reproducible for all newer versions of Django.

@tkdchen
Copy link
Member

tkdchen commented Jan 21, 2020

Hi @tash, thanks for reporting this issue. Would you mind open a PR for this issue?

@tash
Copy link
Author

tash commented Jan 21, 2020

Will do once I have time.

@tkdchen tkdchen added this to the 4.9 milestone Aug 25, 2020
tkdchen added a commit to tkdchen/Nitrate that referenced this issue Sep 8, 2020
Signed-off-by: Chenxiong Qi <qcxhome@gmail.com>
tkdchen added a commit to tkdchen/Nitrate that referenced this issue Sep 8, 2020
Signed-off-by: Chenxiong Qi <qcxhome@gmail.com>
@tkdchen tkdchen linked a pull request Sep 8, 2020 that will close this issue
tkdchen added a commit that referenced this issue Sep 8, 2020
Signed-off-by: Chenxiong Qi <qcxhome@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants