From: Matías Aguirre Date: Sun, 14 Aug 2011 06:19:55 +0000 (-0300) Subject: Use primary email as user ID for Google OpenId. Closes gh-117 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=e99965099cbe48f3c937c4fb4e46f07bbc542534;p=django-social-auth.git Use primary email as user ID for Google OpenId. Closes gh-117 --- 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):