summaryrefslogtreecommitdiffstats
path: root/askbot/deps/django_authopenid/util.py
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2014-09-16 11:04:15 +0700
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2014-09-16 11:04:15 +0700
commita0398a9b4267d363b7aa47f7824ac54fde053e24 (patch)
tree5728b5428a8e39316c9d961e6aac8f66186e996e /askbot/deps/django_authopenid/util.py
parent7f6223ed9ea000e1c940f597adbf46efd9098d6e (diff)
downloadaskbot-a0398a9b4267d363b7aa47f7824ac54fde053e24.tar.gz
askbot-a0398a9b4267d363b7aa47f7824ac54fde053e24.tar.bz2
askbot-a0398a9b4267d363b7aa47f7824ac54fde053e24.zip
attempted to add migration code from Google OpenID to g-Plus
Diffstat (limited to 'askbot/deps/django_authopenid/util.py')
-rw-r--r--askbot/deps/django_authopenid/util.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/askbot/deps/django_authopenid/util.py b/askbot/deps/django_authopenid/util.py
index ef8a1b99..f05aba31 100644
--- a/askbot/deps/django_authopenid/util.py
+++ b/askbot/deps/django_authopenid/util.py
@@ -509,7 +509,7 @@ def get_enabled_major_login_providers():
'resource_endpoint': 'https://www.googleapis.com/plus/v1/people/',
'icon_media_path': '/jquery-openid/images/google.gif',
'get_user_id_function': get_google_user_id,
- 'extra_auth_params': {'scope': ('profile',)}# 'email', 'openid')}#, 'openid.realm': 'http://127.0.0.1:8000'}
+ 'extra_auth_params': {'scope': ('profile', 'email', 'openid'), 'openid.realm': askbot_settings.APP_URL}
}
data['mozilla-persona'] = {
'name': 'mozilla-persona',
@@ -900,3 +900,9 @@ def mozilla_persona_get_email_from_assertion(assertion):
raise ImproperlyConfigured(message)
#todo: nead more feedback to help debug fail cases
return None
+
+def google_migrate_from_openid_to_gplus(openid_url, gplus_id):
+ from askbot.deps.django_authopenid.models import UserAssociation
+ assoc = UserAssociation.object.filter(openid_url=openid_url)
+ assoc.update(openid_url=str(gplus_id), provider_name='google-plus')
+