Ich versuche python-social-auth in Django zu implementieren.wie Benutzer E-Mail mit Python Social Auth mit Facebook erhalten und speichern
Ich möchte, dass Benutzer sich über Facebook authentifizieren und ihre E-Mails speichern.
Ich kann Benutzer authentifizieren, aber die erweiterte Berechtigung für E-Mails wird nicht in der Facebook-Authentifizierungsbox angezeigt und speichert die E-Mail nicht in der Datenbank.
In settings.py Ich habe das follwoing:
SOCIAL_AUTH_FACEBOOK_KEY='xxx'
SOCIAL_AUTH_FACEBOOK_SECRET='xxx'
FACEBOOK_EXTENDED_PERMISSIONS = ['email']
AUTHENTICATION_BACKENDS = (
'social.backends.facebook.FacebookOAuth2',
'social.backends.email.EmailAuth',
'django.contrib.auth.backends.ModelBackend',
)
LOGIN_URL = '/login/'
LOGIN_REDIRECT_URL = '/done/'
LOGOUT_REDIRECT_URL = '/'
URL_PATH = ''
SOCIAL_AUTH_STRATEGY = 'social.strategies.django_strategy.DjangoStrategy'
SOCIAL_AUTH_STORAGE = 'social.apps.django_app.default.models.DjangoStorage'
SOCIAL_AUTH_PIPELINE = (
'social.pipeline.social_auth.social_details',
'social.pipeline.social_auth.social_uid',
'social.pipeline.social_auth.auth_allowed',
'social.pipeline.social_auth.social_user',
'social.pipeline.user.get_username',
'social.pipeline.social_auth.associate_by_email',
# 'users.pipeline.require_email',
'social.pipeline.mail.mail_validation',
'social.pipeline.user.create_user',
'social.pipeline.social_auth.associate_user',
'social.pipeline.social_auth.load_extra_data',
'social.pipeline.user.user_details'
)
Das Facebook-Dialogfeld ...
Wie kann ich dieses Problem lösen?
Funktioniert das immer noch? Ich kann es nicht funktionieren. –
Sie brauchen auch die EXTRA_PARAMS. Siehe Antwort unten. – sureshvv