python-social-auth

'Redirect URI does not match registered redirect URI' using Python Social Auth

折月煮酒 提交于 2019-12-11 03:57:03
问题 I am using python-social-auth for authentication with social networks. I have installed and configured everything. In the last step, I added these two action links: <a href="{% url 'social:begin' 'facebook' %}">Login with Facebook</a> <a href="{% url 'social:begin' 'instagram' %}">Login with Instagram</a> Facebook login is working fine but instagram is giving me the following error: {"code": 400, "error_type": "OAuthException", "error_message": "Redirect URI does not match registered redirect

Check if current user is logged in using any django social auth provider

此生再无相见时 提交于 2019-12-10 04:57:43
问题 I would like to check if a user is logged in via social authentication or using the django default authentication. something like if user.social_auth = true? 回答1: Ok after doing some research i came up with this solution to make sure if a user is authenticated using any social provider or just the default django auth. Check here for moreinfo.. {% if user.is_authenticated and not backends.associated %} #Do or show something if user is not authenticated with social provider but default auth {%

Python Social Auth duplicating e-mails for different users

我是研究僧i 提交于 2019-12-08 05:48:25
问题 In my website it is possible to login through: username and password e-mail and password google auth 2 facebook Where I am using django user built in system and python social auth. The problem: Suppose I create the following account: username: losimonassi e-mail: lorenzosimonassi@gmail.com Then when I try to login with my gmail (lorenzosimonassi@gmail.com) python social auth creates another user with the same e-mail. So, when I try to login using my e-mail the auth system finds two similar e

Open New Window for Social Login and then Close and Return to Parent On Success with Django

孤街醉人 提交于 2019-12-07 01:52:30
问题 I'm working with Django 1.6.2 and Python-Social-Auth 0.1.23. I'm also working with Twitter Bootstrap as my templating engine. I've worked python-social-auth into my template and implemented a LinkedIn log in for my customers and I've coded it so that the login opens in a new window using javascript. <li> <a class="btn" href="" onclick="window.open('{% url 'social:begin' 'linkedin' %}', '_blank', 'location=yes,height=570,width=520,scrollbars=yes,status=yes');"> <span class="glyphicon glyphicon

400 Client Error: Bad Request using python-social-auth for Facebook auth in Django

*爱你&永不变心* 提交于 2019-12-06 11:33:38
问题 Lately some strange errors have happened in a project I'm working on. It was working perfectly fine when one day (without any changes on our side that I know of) Facebook authentication with python-social-auth for django stopped working. The error given was "400 Client Error: Bad Request" and seemingly occurred in the /complete/facebook callback. I have tried switching to older code, creating a new Facebook app from scratch and switching the settings of the existing one, all to no avail. Does

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

喜你入骨 提交于 2019-12-05 15:13:47
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 scope is set via the SOCIAL_AUTH_FACEBOOK_SCOPE setting, and it's not possible to ask for a different

Open New Window for Social Login and then Close and Return to Parent On Success with Django

偶尔善良 提交于 2019-12-05 06:19:35
I'm working with Django 1.6.2 and Python-Social-Auth 0.1.23. I'm also working with Twitter Bootstrap as my templating engine. I've worked python-social-auth into my template and implemented a LinkedIn log in for my customers and I've coded it so that the login opens in a new window using javascript. <li> <a class="btn" href="" onclick="window.open('{% url 'social:begin' 'linkedin' %}', '_blank', 'location=yes,height=570,width=520,scrollbars=yes,status=yes');"> <span class="glyphicon glyphicon-user"></span> Sign In</a></li> My question is, how can I close this child window and reload the parent

How can I refresh the token with social-auth-app-django?

青春壹個敷衍的年華 提交于 2019-12-05 05:17:16
问题 I use Python Social Auth - Django to log in my users. My backend is Microsoft, so I can use Microsoft Graph but I don't think that it is relevant. Python Social Auth deals with authentication but now I want to call the API and for that, I need a valid access token. Following the use cases I can get to this: social = request.user.social_auth.get(provider='azuread-oauth2') response = self.get_json('https://graph.microsoft.com/v1.0/me', headers={'Authorization': social.extra_data['token_type'] +

AttributeError: 'DjangoStrategy' object has no attribute 'backend' python social auth

帅比萌擦擦* 提交于 2019-12-05 01:39:29
问题 This worked last week. Maybe I did something wrong and messed it up somewhere else, or maybe it is a bug, or maybe it is just an update and I missed it while reading the docs. I have a pipeline that gets the user's avatar and saves the URL: def get_avatar(strategy, details, response, user, *args, **kwargs): url = None if strategy.backend.name == 'facebook': url = 'http://graph.facebook.com/{0}/picture'.format(response['id']) elif strategy.backend.name == "twitter": if response['profile_image

Are sessions needed for python-social-auth

房东的猫 提交于 2019-12-03 04:43:55
问题 I'm building a django app with an API backend(built with DRF) and angularjs client. My goal is to completely decouple the server and client using JWT in place of sessions. I'm attempting to integrate python-social-auth(PSA) with django-rest-framework-jwt(DRFJWT), so my goal is to have an auth flow something to this: User logs with Email/facebook via angular client -> client posts form to PSA's url -> PSA login/create user ->[!] DRFJWT creates token that it then sends back to client -> client