summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Chen <yongjhih@gmail.com>2014-02-06 14:55:13 +0800
committerAndrew Chen <yongjhih@gmail.com>2014-02-06 15:04:50 +0800
commitf701bb0808d1874a3eff20d167c412958d0a1db0 (patch)
tree7366603bb17bab6712706de40f426975a9963ff2
parent6e14c8c1751a0fb23517b44d363fb11a1c8d5aa0 (diff)
downloadaskbot-f701bb0808d1874a3eff20d167c412958d0a1db0.tar.gz
askbot-f701bb0808d1874a3eff20d167c412958d0a1db0.tar.bz2
askbot-f701bb0808d1874a3eff20d167c412958d0a1db0.zip
Oauth2: Facebook: Fix email not found
-rw-r--r--askbot/deps/django_authopenid/util.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/askbot/deps/django_authopenid/util.py b/askbot/deps/django_authopenid/util.py
index 06379e1d..d154847b 100644
--- a/askbot/deps/django_authopenid/util.py
+++ b/askbot/deps/django_authopenid/util.py
@@ -403,7 +403,8 @@ def get_enabled_major_login_providers():
'resource_endpoint': 'https://graph.facebook.com/',
'icon_media_path': '/jquery-openid/images/facebook.gif',
'get_user_id_function': get_facebook_user_id,
- 'response_parser': lambda data: dict(urlparse.parse_qsl(data))
+ 'response_parser': lambda data: dict(urlparse.parse_qsl(data)),
+ 'scope': ['email',],
}
if askbot_settings.TWITTER_KEY and askbot_settings.TWITTER_SECRET:
@@ -825,7 +826,7 @@ def get_oauth2_starter_url(provider_name, csrf_token):
client_id=client_id,
redirect_uri=redirect_uri
)
- return client.auth_uri(state=csrf_token)
+ return client.auth_uri(state=csrf_token, scope=params['scope'])
def ldap_check_password(username, password):