django-socialauth

Django social auth error logging in with two email accounts

孤街醉人 提交于 2020-01-05 04:26:12
问题 My application must be accessed through an account like user@mydomain.com (Google managed email account) First time I launch my application I can log in normally using that account. The problem starts when I log out (django log out) and try to login with my Gmail account (This is not allowed because of my email verification pipeline) The first account is my user@mydomain.com and the second is my user@gmail.com account I have a pipeline to verify if the user email belongs to my domain Clicking

How can I get Google Auth2 authentication with Extra Scopes to work?

 ̄綄美尐妖づ 提交于 2020-01-04 12:50:02
问题 I've set up my Django social auth according to the documentation. With the following: GOOGLE_OAUTH_EXTRA_SCOPE = ['https://www.googleapis.com/auth/calendar'] GOOGLE_OAUTH2_CLIENT_ID = *client id here* GOOGLE_OAUTH2_CLIENT_SECRET = *client secret here* In the API console, I have set it to a web application with the Redirect URI as omab says: http://localhost:8000/complete/google-oauth2/ In my template I have: <a href="{% url socialauth_begin 'google' %}" class="google_login_button">Login with

How can I get Google Auth2 authentication with Extra Scopes to work?

左心房为你撑大大i 提交于 2020-01-04 12:48:24
问题 I've set up my Django social auth according to the documentation. With the following: GOOGLE_OAUTH_EXTRA_SCOPE = ['https://www.googleapis.com/auth/calendar'] GOOGLE_OAUTH2_CLIENT_ID = *client id here* GOOGLE_OAUTH2_CLIENT_SECRET = *client secret here* In the API console, I have set it to a web application with the Redirect URI as omab says: http://localhost:8000/complete/google-oauth2/ In my template I have: <a href="{% url socialauth_begin 'google' %}" class="google_login_button">Login with

How to access request.user while testing?

依然范特西╮ 提交于 2020-01-03 20:06:30
问题 I just moved from Django 1.3.1 to Django 1.4. Right after doing so, a real big number of my tests started to raise these errors: Traceback (most recent call last): File "/Volumes/Data/ADay/Website/Backend/(trunk)/project/tests/templatetags.py", line 406, in setUp self.context = template.RequestContext(self.request) File "/Library/Python/2.6/site-packages/django/template/context.py", line 176, in __init__ self.update(processor(request)) File "/Volumes/Data/ADay/Website/Backend/(trunk)/project

Logout with django-social-auth

瘦欲@ 提交于 2019-12-30 03:15:07
问题 I am dabbling a little with django-social-auth using twitter authentication. I can login. But, when I try to log out using django.contrib.auth.logout , it doesn't log out. What's the way to logout? Thanks. 回答1: Are you trying to log out just from the Django app or do you want to "forget" the Twitter access? Usually the twitter auth token is stored for simplified login the next time a user wants to connect to twitter, so the user doesn't have to "accept" the access again. Django logout If you

Identifying the backend provider of a logged in user

时间秒杀一切 提交于 2019-12-25 01:17:02
问题 With django-social-auth, is there a good way to find out the backend provider of a logged in user? Is finding the corresponding UserSocialAuth object supposedly the best way? Thanks! 回答1: In your views, try: request.user.social_auth.values_list('provider') to get a list of the user's connected backends. 回答2: The last login provider is stored in the session using the key social_auth_last_login_backend by default, otherwise yes, checking the UserSocialAuth instances is the preferred way by

django-social-auth gives 502 error with Google OpenID, but only with a few users

六眼飞鱼酱① 提交于 2019-12-24 15:38:58
问题 I've been fighting with a bug for the past few weeks that's been driving me nuts. Please help! Here's the symptom: If the user is not logged in to GMail, he can login to my site (using GMail openID) without problems. This will oviously prompt the user to authenticate in GMail first. However if the user is already authenticated in GMail, he sees a 502 error page, generated by nginx. This only happens to a few users (I'm not one of them), and one of them was kind enough to report and even made

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(

AuthAlreadyAssociated Exception in Django Social Auth

会有一股神秘感。 提交于 2019-12-18 12:28:42
问题 After I create a user using say Facebook(let's say fbuser) or Google(googleuser). If I create another user through the normal django admin(normaluser), and try logging again using Facebook or Google while third user(normaluser) is logged in, it throws an error exception AuthAlreadyAssociated. Ideally it should throw an error called you are already logged in as user normaluser. Or it should log out normal user, and try associating with the account which is already associated with FB or Google,

django-social-auth django-registration and django-profiles — together

被刻印的时光 ゝ 提交于 2019-12-18 10:14:06
问题 Has anyone used django-social-auth, django-registration and django-profiles together. Do they work well together? I have established social-auth but I read somewhere that django-allauth is better. Should I switch over to that? Please advise Update: I have used allauth in my project and it is working fine. You don't need to use django-registration with allauth because that is integrated within. However I am using custom user profiles and that is a better option than the django-profiles . 回答1: