From e99965099cbe48f3c937c4fb4e46f07bbc542534 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mat=C3=ADas=20Aguirre?= Date: Sun, 14 Aug 2011 03:19:55 -0300 Subject: [PATCH] Use primary email as user ID for Google OpenId. Closes gh-117 --- social_auth/backends/google.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/social_auth/backends/google.py b/social_auth/backends/google.py index efc4a3d..9550121 100644 --- a/social_auth/backends/google.py +++ b/social_auth/backends/google.py @@ -72,6 +72,11 @@ class GoogleBackend(OpenIDBackend): """Google OpenID authentication backend""" name = 'google' + def get_user_id(self, details, response): + """Return user unique id provided by service. For google user email + is unique enought to flag a single user. Email comes from schema: + http://axschema.org/contact/email""" + return details['email'] # Auth classes class GoogleAuth(OpenIdAuth): -- 2.39.5