Facebook backend problem

69 views
Skip to first unread message

Max Friedrich

unread,
Jul 21, 2015, 9:31:50 AM7/21/15
to django-so...@googlegroups.com
Hello I'd like to allow users to login/register through facebook. 
Authentication works but backend creates User instance with the combination of first and last name (from Facebook) as a username and no email.
Google oauth2 backend works just fine.

Here are my settings:
FACEBOOK_APP_ID                   = 'appid'
FACEBOOK_API_SECRET = 'apisecret'
FACEBOOK_EXTENDED_PERMISSIONS = ['email']

SOCIAL_AUTH_CREATE_USERS = True
SOCIAL_AUTH_FORCE_RANDOM_USERNAME = False
SOCIAL_AUTH_DEFAULT_USERNAME = 'socialauth_user'
SOCIAL_AUTH_COMPLETE_URL_NAME = 'socialauth_complete'
SOCIAL_AUTH_ASSOCIATE_URL_NAME = 'socialauth_associate_complete'
LOGIN_ERROR_URL = '/login/error/'
LOGIN_REDIRECT_URL = '/'
SOCIAL_AUTH_USER_MODEL = 'users.User'
SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'

I can't overcome this.
Can anyone help?

Matías Aguirre

unread,
Jul 21, 2015, 11:53:34 AM7/21/15
to DSA Group
You can add a simple pipeline function that will normalize your
facebook usernames, take a look to the docs at
http://django-social-auth.readthedocs.org/en/latest/pipeline.html#authentication-pipeline.

BTW, django-social-auth is a deprecated library.

Matías
> --
> You received this message because you are subscribed to the Google Groups
> "Django Social Auth" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-social-a...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Matías Aguirre
http://matiasaguirre.net
Reply all
Reply to author
Forward
0 new messages