python-social-auth

python-social-auth - how could I disconnect in Django?

≡放荡痞女 提交于 2019-12-23 04:17:28
问题 I'm using a tag with href like /disconnect/backend/ and then it shows me an empty page. I've tried {% url %} template tag like: {% url 'social:disconnect' 'twitter' %} And it's still create same url as I've used in the tag. How could I disconnect account? Or maybe there are also a way to get only one account associated? 回答1: Answer is very simple. You should use POST request. I've done it like those: <form action="{% url 'social:disconnect' 'twitter' %}" method="post"> {% csrf_token %}

How can I ask for different permissions from facebook at different times?

旧时模样 提交于 2019-12-22 08:25:58
问题 Facebook recommends that when using facebook login you should initially ask the user for as few permissions as possible, and in particular avoid requesting publish permissions until the user needs to publish something via your site - https://developers.facebook.com/docs/facebook-login/permissions/#optimizing. We've been trying to implement this using python-social-auth's django app, but it seems that there's no way of asking for different permissions at different points in the site - the

Django. Python social auth. create profiles at the end of pipeline

梦想与她 提交于 2019-12-21 18:03:43
问题 I want to add a function at the end of the auth pipeline, the function is meant to check if there is a "Profiles" table for that user, if there isn't it will create a table. The Profiles model is a table where I store some extra information about the user: class Profiles(models.Model): user = models.OneToOneField(User, unique=True, null=True) description = models.CharField(max_length=250, blank=True, null=True) points = models.SmallIntegerField(default=0) posts_number = models

python-social-auth not getting correct Google OAuth2 details

白昼怎懂夜的黑 提交于 2019-12-21 04:35:20
问题 I want to login a user using the python-social-auth functionality for Google Plus signin in Django. When logging in from my website, everything works fine and the correct details are added to the database. However, I want to authenticate from my Android application as well. The user logs in in the application, which then sends the access token to the django API, which handles the login process in the following code, adapted from the documentation: @csrf_exempt @serengeti_api_request @psa(

Retrieving profile picture from google and facebook in python-social-auth

故事扮演 提交于 2019-12-20 10:08:59
问题 How can I retrieve profile picture and date of birth from google and facebook using python-social-auth by extending pipeline? I've read that I can make functions to do so and set path to them but I don't know the attribute names that I must retrieve. Please help! 回答1: To get avatars from social login, you need create a pipeline.py file in your app and add this lines to settings.py: SOCIAL_AUTH_PIPELINE = ( 'social.pipeline.social_auth.social_details', 'social.pipeline.social_auth.social_uid',

python-social-auth + mobile app

天大地大妈咪最大 提交于 2019-12-19 10:25:41
问题 I have a django app and I create API for mobile app. When it comes to user authentication I simple gets login + pass and do standard django login stuff. When user is logged in I generate a token, save it and provide to the mobile app. Now it comes to Facebook and I would like to implement python-social-auth library. I do know how to implement it for standard web, it's really trivial. But I have no idea, how to implement it into my mobile API and how to incorporate there my token stuff. Just

Pinterest OAuth Redirect Uri not working

送分小仙女□ 提交于 2019-12-12 15:30:57
问题 I've been trying to get the pinterest api working on my project but I keep running into an issue with the redirect_uri. This is the error message I am getting. { status : "failure", code : 7, host : "coreapp-ngapi-prod-0a018ab7", generated_at : "Sat, 15 Apr 2017 00:45:16 +0000", message : "You are not permitted to access that resource.", data : "The provided redirect_uri https://example.com/complete/pinterest/ does not match any of the registered redirect URIs." } I am running my site on

After changed latin1_swedish_ci to utf8_general_ci can't migrate db

不想你离开。 提交于 2019-12-12 04:11:38
问题 Yesterday I deleted my db tables, cause I needed change latin1_swedish_ci to utf8_general_ci for have a polish words in my apps. After that i can't do full migrate my database, because I have problem like that: (venv) C:\netbast\fastandbeauty\project>manage.py migrate Operations to perform: Apply all migrations: admin, auth, comments, contenttypes, registration, sessions, social_django, user_content, user_profile Running migrations: Applying social_django.0005_auto_20160727_2333...Traceback

python-social-auth Facebook and LinkedIn user's email is empty

有些话、适合烂在心里 提交于 2019-12-11 14:06:24
问题 I am developing a Django web app using python-social-auth. I have this in my Django settings: SOCIAL_AUTH_GOOGLE_OAUTH2_KEY = 'xxx' SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET = 'xxx' SOCIAL_AUTH_FACEBOOK_KEY = 'xxx' SOCIAL_AUTH_FACEBOOK_SECRET = 'xxx' SOCIAL_AUTH_FACEBOOK_SCOPE = ['email',] SOCIAL_AUTH_LINKEDIN_OAUTH2_KEY = 'xxx' SOCIAL_AUTH_LINKEDIN_OAUTH2_SECRET = 'xxx' SOCIAL_AUTH_LINKEDIN_OAUTH2_SCOPE = ['r_basicprofile', 'r_emailaddress'] Now Google sets user's email just fine in auth.user model

python-social-auth and github, I have this error “The redirect_uri MUST match the registered callback URL for this application”

不羁的心 提交于 2019-12-11 07:37:52
问题 I'm using python-social-auth on a project to authenticate the user with Github. I need to redirect the user depending on the link they use. To do that I'm using the next attribute on the url, and I didn't declare any redirect url on my github app neither in my django settings. This is the href attribute I'm using for my link : {% url 'social:begin' 'github' %}?next={% url 'apply' j.slug %} And the first time I click on it, I'm getting redirected to my homepage with this error in the url field