我从https://github.com/omab/django-social-auth获得 django social auth并按照其说明进行操作。
我正在使用google oauth
,yahoo auth
但问题是它无法获取用户的first name
和lastname
,所以我想用来OpenID
在数据库中保存first name
, last name
, email
, 等...但是在文档中我无法理解如何实现 id .
我还去了http://openid.net/get-an-openid/也许我可以制作一个应用程序,但我找不到如何去做。
我的问题是如何OpenID
在我的 django 中启用 google 和 yahoo?
这就是我在 settings.py 中所做的
AUTHENTICATION_BACKENDS = (
'userena.backends.UserenaAuthenticationBackend',
'guardian.backends.ObjectPermissionBackend',
'django.contrib.auth.backends.ModelBackend',
'social_auth.backends.facebook.FacebookBackend',
'social_auth.backends.twitter.TwitterBackend',
'social_auth.backends.google.GoogleOAuthBackend',
'social_auth.backends.google.GoogleOAuth2Backend',
'social_auth.backends.google.GoogleBackend',
'social_auth.backends.yahoo.YahooBackend',
'social_auth.backends.OpenIDBackend'
)
#facebook
FACEBOOK_APP_ID = '45252'
FACEBOOK_API_SECRET = '234324'
FACEBOOK_EXTENDED_PERMISSIONS = ['email']
#twitter
TWITTER_CONSUMER_KEY = '234324'
TWITTER_CONSUMER_SECRET = '234234'
TWITTER_EXTENDED_PERMISSIONS = ['email']
#google
#GOOGLE_OAUTH2_CLIENT_ID = 23423#''
#GOOGLE_OAUTH2_CLIENT_SECRET = '234324'
#GOOGLE_APP_ID = '23432'
#GOOGLE_APP_KEY = '234'
#GOOGLE_SREG_EXTRA_DATA = ''#[('First name', '...')]
#GOOGLE_AX_EXTRA_DATA = ''# [('...', '...')]
#yahoo
#YAHOO_CONSUMER_KEY = '234342'
#YAHOO_CONSUMER_SECRET = '234234'
当我访问http://127.0.0.1:8000/associate/google/
或http://127.0.0.1:8000/associate/yahoo/
它进入雅虎或谷歌的登录但它没有登录我的我的 django 项目并且当我查看我的数据库时,没有创建用户......
我认为使用OpenID
forgoogle
并且yahoo
不需要KEY
or ID
。所以它不需要app
像我所做的那样facebook
吗twitter
?
我总是在我的日志中得到这个:
Generated checkid_setup request to https://www.google.com/accounts/o8/ud with assocication AMlYA9XiAAnknkW9He8EyJeKuzgFtnhl9YByYurLWutc80ZtG_5XwbOW
[02/Jun/2012 15:00:23] "GET /associate/google/ HTTP/1.1" 200 2390
Error attempting to use stored discovery information: <openid.consumer.consumer.TypeURIMismatch: Required type http://specs.openid.net/auth/2.0/signon not found in ['http://specs.openid.net/auth/2.0/server', 'http://openid.net/srv/ax/1.0', 'http://specs.openid.net/extensions/ui/1.0/mode/popup', 'http://specs.openid.net/extensions/ui/1.0/icon', 'http://specs.openid.net/extensions/pape/1.0'] for endpoint <openid.consumer.discover.OpenIDServiceEndpoint server_url='https://www.google.com/accounts/o8/ud' claimed_id=None local_id=None canonicalID=None used_yadis=True >>
Attempting discovery to verify endpoint
Performing discovery on https://www.google.com/accounts/o8/id?id=AItOawmyGFHvB71i5EXC9I1dyjOKEXxIPJtHRqM
Received id_res response from https://www.google.com/accounts/o8/ud using association AMlYA9XiAAnknkW9He8EyJeKuzgFtnhl9YByYurLWutc80ZtG_5XwbOW
No handlers could be found for logger "SocialAuth"
有人可以帮助我如何申请OpenID
和google
参与yahoo
我的 django 项目吗?
提前致谢 ....