From: User Date: Sat, 18 Feb 2012 18:21:23 +0000 (-0500) Subject: Get GAE backend working properly. X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=e352c6d84ed25e9bda8168f7e20719a9789fb043;p=django-social-auth.git Get GAE backend working properly. --- diff --git a/social_auth/backends/gae.py b/social_auth/backends/gae.py index ede1c0b..0d57a37 100644 --- a/social_auth/backends/gae.py +++ b/social_auth/backends/gae.py @@ -28,7 +28,7 @@ class GAEBackend(SocialAuthBackend): # 'issuer': 'browserid.org'} user = users.get_current_user() return {USERNAME: user.user_id(), - 'email': user.email, + 'email': user.email(), 'fullname': '', 'first_name': '', 'last_name': ''} @@ -39,13 +39,19 @@ class GAEAuth(BaseAuth): AUTH_BACKEND = GAEBackend def auth_url(self): - return users.create_login_url() + return users.create_login_url('/complete/gae') def auth_complete(self, *args, **kwargs): - """Completes loging process, must return user instance""" + """Completes login process, must return user instance""" if not users.get_current_user(): raise ValueError('Authentication error') + """ Setting these two are necessary for BaseAuth.authenticate to work """ + kwargs.update({ + 'response' : '', + self.AUTH_BACKEND.name: True + }) + return authenticate(*args, **kwargs) # Backend definition