Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Social auth #47

Open
javiermaly opened this issue Oct 16, 2015 · 7 comments
Open

Social auth #47

javiermaly opened this issue Oct 16, 2015 · 7 comments

Comments

@javiermaly
Copy link

Hi @arocks !

Thank you very much for this template, it is really very useful.

Another very important thing for this project would be to integrate a social login with Facebook and Twitter at least, in addition to maintaining the Edge login; I mean incorporate something like django-allauth.
In this case i don't know how because the User model has been modified to keep the email as a key.

Can you help with that?

Thanks so much.
Regards

@arocks
Copy link
Owner

arocks commented Dec 13, 2015

This is frequently requested, but adds a heavy dependency to allauth. Looking for alternatives.

@javiermaly
Copy link
Author

What about python-social-auth?

@jcda
Copy link

jcda commented Dec 20, 2015

I had some success* with python-social-auth, but I removed the local user for the moment.
I had to change back the username to username and not "email" as it was forced in edge ( search for "ugly hack" in the comments ) .
Also twitter doesn't provide emails through their authentication.
I started to put the code in my profile, but it's not completely finished yet. If it can help, I left it here https://github.com/jcda/django-edge-PSA-integration . It still requires plenty of work, but the authentication via twitter and Google+ works.

*: with some help from someone from Elance too, I am still learning a lot in Django.

@javiermaly
Copy link
Author

I start play with python-social-auth and edge; it's true that you must have a username based auth system.

This are some settings who play's well with that condition:

AUTHENTICATION_BACKENDS = (
'social.backends.google.GoogleOAuth2',
'social.backends.facebook.FacebookOAuth2',
'social.backends.twitter.TwitterOAuth',
'social.backends.email.EmailAuth',
'social.backends.username.UsernameAuth',
'django.contrib.auth.backends.ModelBackend',
)

SOCIAL_AUTH_USERNAME_IS_FULL_EMAIL = True
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.mail.mail_validation',
'social.pipeline.social_auth.associate_by_email',
'social.pipeline.user.create_user',
'social.pipeline.social_auth.associate_user',
'social.pipeline.social_auth.load_extra_data',
'social.pipeline.user.user_details'
)

Maybe you can try with your user model in a new pipeline for example.

With this settings, the username is the mail of the social user; there's a restriction to 30 characters...

Regards.

@vermaakarsh
Copy link

@arocks Great template.. switching to edge after starring with pinax.. notice this post is old.. is there so support for social auth in the current release

@arocks
Copy link
Owner

arocks commented Apr 10, 2018 via email

@vermaakarsh
Copy link

Not denying the trend.. I should have rather said Gmail (google auth) based login rather than Social login..

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

4 participants