social-app-django
social-app-django copied to clipboard
You have multiple authentication backends configured and therefore must provide the `backend` argument or set the `backend` attribute on the user.
I get this error when trying to activate a new user from verification code:
You have multiple authentication backends configured and therefore must provide the
backendargument or set the
backend attribute on the user.
I've updated my activate function to specify the default authentication channel but still no luck:
def activate(request, uidb64, token, backend='django.contrib.auth.backends.ModelBackend'):
Have the same issue. I've it solved by specifying auth backend directly like this:
login(strategy.request, user, backend='social_core.backends.google.GoogleOAuth2')
But it's not a clear solution, because it works only for GoogleOAuth2
@xelawafs Did you solve it?
@xelawafs, how's this activation flow implemented? Is it part of a partial-pipeline flow?
setting a backend with
user = authenticate(request, username=username, password=raw_password, backend='django.contrib.auth.backends.ModelBackend')
throws 'unicode' object has no attribute 'name'
.
/Users/Gregor/.local/share/virtualenvs/###/lib/python2.7/site-packages/social_core/backends/base.py in authenticate
if 'backend' not in kwargs or kwargs['backend'].name != self.name or \
@gregorvolkmann, backend
parameter for login
function (django.contrib.auth.login
) must be in the form of an import path, while backend
parameter for authenticate
function (django.contrib.auth.authenticate
) must be in the form of what an authentication backend will expect. In the case of social auth backends, it must be the backend instance not the dotted import path.
ModelBackend
doesn't require the backend
paramater.
@omab, correct! Solved it by dropping authenticate() and taking the user from my form:
if form.is_valid():
user = form.save()
login(request, user, backend='django.contrib.auth.backends.ModelBackend')
@omab, correct! Solved it by dropping authenticate() and taking the user from my form:
if form.is_valid(): user = form.save() login(request, user, backend='django.contrib.auth.backends.ModelBackend')
Thxk mate its workking
if form.is_valid(): user = form.save() login(request, user, backend='django.contrib.auth.backends.ModelBackend')
For me specifying just the backend worked, backend='django.contrib.auth.backends.ModelBackend'
which actually is one of the options for login
I am also facing the same issue . Any update ?