How can I use Django 1.5 Custom User Model and Social Auth?

It is reported that Django Social Auth (0.7.22) supports user models of users, but I could not get this to work.

In my case, I use Google Oauth2, which works with a non-standard user model for me.

In the user model of the user, I am redirected correctly to the Google account page, select an account to log in, and then redirected to LOGIN_ERROR_URL without messages or debugging information.

To simplify debugging, I created a simple project example with minimal bits and pieces in https://github.com/jonathanendersby/SocialAuthCustomUserModel

Has anyone got this to work, and can they indicate where I did wrong?

+7
source share
1 answer

This issue is now resolved in the repo at https://github.com/jonathanendersby/SocialAuthCustomUserModel

Quote https://github.com/omab :

The problem was with the parameters that create_user () created, and not all of them are available on all backends.

Replacing the method signature with the same one from the django manager, and setting some default values ​​to the first_name and last_name fields in your model, it works fine.

+1
source

All Articles