django-socialauth

How to login using facebook in development environment using django social-auth?

泄露秘密 提交于 2019-12-07 03:59:26
问题 I'm using social-auth with my django web app. When I go to /login/facebook in the production environment, the user is able to login using their facebook data. However in my development environment when I access http://localhost:8000/login/facebook/, I get an error saying An error occurred. Please try again later. API Error Code: 191 API Error Description: The specified URL is not owned by the application Error Message: Invalid redirect_uri: Given URL is not allowed by the Application

A simple and up-to-date way to implement Facebook login in a Django app

Deadly 提交于 2019-12-06 13:53:36
This issue is very common in stackoverflow, and there's a lot of different questions and answers about it, yet I couldn't find exactly what I need. First, I'd like to define exactly what I need: the option to let users log in to my app using their Facebook credentials. The app will save a matching classic Django user. I will only need to use the user's profile picture and to make sure that each time the same Facebook user will be related to the matching Django user. Unfortunately, I find it really frustrating to implement for the following reasons: By now, after reading a lot, I couldn't find

django social auth with custom user model is not working

对着背影说爱祢 提交于 2019-12-06 11:41:38
i am trying to implement django social auth in my project and i am having trouble integrating it with my custom user model. Whenever i try to login to facebook, it is throwing an error and always re-directing to LOGIN_ERROR_URL Page. My settings.py file looks like below. FACEBOOK_APP_ID = 'xxxxx' FACEBOOK_API_SECRET = 'xxxxx' AUTHENTICATION_BACKENDS = ( 'social_auth.backends.facebook.FacebookBackend', 'django.contrib.auth.backends.ModelBackend', ) SOCIAL_AUTH_PIPELINE = ( 'social_auth.backends.pipeline.social.social_auth_user', 'social_auth.backends.pipeline.associate.associate_by_email',

How can i get a specific provider from Django social-auth in a template?

两盒软妹~` 提交于 2019-12-06 10:44:08
After installing and setting up social-auth i'm playing around a bit, trying to get the hang of it. I have read the docs, and have used the example project to get it running. But until now i have no idea how to get information on a certain provider. In the example project the templatetags are always used this way: {% for type, accounts in social_auth.associated.items %} {% for account in accounts %} {{account.provider}} is connected. {% endfor %} {% endfor %} What i want to do now is not list all the providers, but check if someone has connected his account to (ie.) facebook. That way i could

Retrieve all contacts from gmail using python

故事扮演 提交于 2019-12-05 07:40:54
问题 I am using django social auth in order to retrieve contacts from gmail. I do not have any problem getting the authorization. I do a request and then I use lxml to retrieve the email addresses. The problem is that it does not display every contacts. For example, I can retrieve only 30 contacts while I have more than 300 contacts with my gmail account. Here is my view : def get_email_google(request): social = request.user.social_auth.get(provider='google-oauth2') url = 'https://www.google.com

How to have unique emails with python social auth

耗尽温柔 提交于 2019-12-04 12:11:55
问题 I'm using Python Social Auth (django) with Google and Facebook and it creates different users with the same email. How do I fix that? If I log first with google, logout and then with facebook, it must just associate the accounts and not create. Thanks, 回答1: After some code reading I found this in the pipeline: 'social.pipeline.social_auth.associate_by_email', So, I just added it before 'social.pipeline.user.get_username', And it worked. 来源: https://stackoverflow.com/questions/19273904/how-to

How can I use Django Social Auth to connect with Twitter?

青春壹個敷衍的年華 提交于 2019-12-03 07:26:40
问题 I'm trying to use the Django Social Auth package to connect with Twitter, but I'm having difficulty understanding how exactly to do this as I can't find any examples. I am assuming that Django Social Auth is the best package to use for this purpose. I've looked at a few examples that use Facebook, and from this have added the following to my settings.py file: AUTHENTICATION_BACKENDS = ( 'social_auth.backends.twitter.TwitterBackend', 'django.contrib.auth.backends.ModelBackend', ) # overwriting

How can I handle Exceptions raised by django-social-auth?

隐身守侯 提交于 2019-12-03 06:57:09
问题 In django-social-auth , there are a few instances where a backend will raise a ValueError (such as when a user cancels a login request or if a user tries to associate with an account that's already been associated with another User). If a User runs into one of these scenarios, they'll be presented with a 500 error on your site. So, what's the best way to catch these? I'd prefer to be able to display a useful message (via the messages framework) when this happens, but I'm at a loss as to the

How can I use Django Social Auth to connect with Twitter?

流过昼夜 提交于 2019-12-02 20:58:04
I'm trying to use the Django Social Auth package to connect with Twitter, but I'm having difficulty understanding how exactly to do this as I can't find any examples. I am assuming that Django Social Auth is the best package to use for this purpose. I've looked at a few examples that use Facebook, and from this have added the following to my settings.py file: AUTHENTICATION_BACKENDS = ( 'social_auth.backends.twitter.TwitterBackend', 'django.contrib.auth.backends.ModelBackend', ) # overwriting default templates TEMPLATE_CONTEXT_PROCESSORS = ( 'django.core.context_processors.static', 'django

South migration for social auth

大兔子大兔子 提交于 2019-12-02 16:16:13
问题 I am using south in my django project. I just added social_auth in settings.py, when i run this command: python manage.py schemamigration social_auth --auto It says: Nothing seems to have changed. Please let me know how can i create tables for social auth, as by this command the table is not getting created. 回答1: I don't think you need to generate migrations for social_auth, since this app should already have its migrations. Rather, you need to execute them, so after you added 'social_auth'