Authlogic OpenID:从提供商处获取电子邮件

时间:2010-05-21 13:13:52

标签: ruby-on-rails authlogic-oid openid-selector

这是一个非常奇怪的问题:我已经设置了authlogic_openid_selector_example app。当我注册时,openid提供商第一次不会返回电子邮件ID。但是,如果我删除帐户并再次注册,则会返回电子邮件ID。我该如何解决这个问题?我在这里托管了我的应用版本:http://pingauthtest.heroku.com/

我查看了我的开发日志,并且提供商第一次没有返回包含电子邮件ID的openid.ext1.value.ext0。仅在首先删除帐户后才会第二次返回。

编辑:调试的一些额外信息:

THIS IS WHEN IT REGISTERS:



  OpenIdAuthentication::Association Load (5.3ms)   SELECT * FROM "open_id_authentication_associations" WHERE ("open_id_authentication_associations"."server_url" = E'https://www.google.com/accounts/o8/ud') 
Generated checkid_setup request to https://www.google.com/accounts/o8/ud with assocication AOQobUde_9BUnQsk91rb_Sf9tguJ-S7Gpkwahc-nvDGDYAC8nphisNqu
Redirected to https://www.google.com/accounts/o8/ud?
openid.assoc_handle=AOQobUde_9BUnQsk91rb_Sf9tguJ-S7Gpkwahc-nvDGDYAC8nphisNqu

&openid.ax.mode=fetch_request
&openid.ax.required=ext0
&openid.ax.type.ext0=http%3A%2F%2Faxschema.org%2Fcontact%2Femail
&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select
&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select
&openid.mode=checkid_setup
&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0
&openid.ns.ax=http%3A%2F%2Fopenid.net%2Fsrv%2Fax%2F1.0
&openid.ns.sreg=http%3A%2F%2Fopenid.net%2Fextensions%2Fsreg%2F1.1
&openid.realm=http%3A%2F%2Flocalhost%3A3000%2F
&openid.return_to=http%3A%2F%2Flocalhost%3A3000%2Faccount%3Ffor_model%3D1%26_method%3Dpost%26open_id_complete%3D1
&openid.sreg.required=email
Completed in 3574ms (DB: 14) | 302 Found [http://localhost/account]

THIS IS WHEN IT USES SESSIONS:


 OpenIdAuthentication::Association Load (5.3ms)   SELECT * FROM "open_id_authentication_associations" WHERE ("open_id_authentication_associations"."server_url" = E'https://www.google.com/accounts/o8/ud') 
Generated checkid_setup request to https://www.google.com/accounts/o8/ud with assocication AOQobUde_9BUnQsk91rb_Sf9tguJ-S7Gpkwahc-nvDGDYAC8nphisNqu
Redirected to https://www.google.com/accounts/o8/ud?
openid.assoc_handle=AOQobUde_9BUnQsk91rb_Sf9tguJ-S7Gpkwahc-nvDGDYAC8nphisNqu

&openid.ax.mode=fetch_request
&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select
&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select
&openid.mode=checkid_setup
&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0
&openid.ns.ax=http%3A%2F%2Fopenid.net%2Fsrv%2Fax%2F1.0
&openid.ns.sreg=http%3A%2F%2Fopenid.net%2Fextensions%2Fsreg%2F1.1
&openid.realm=http%3A%2F%2Flocalhost%3A3000%2F
&openid.return_to=http%3A%2F%2Flocalhost%3A3000%2Fuser_session%3Ffor_session%3D1%26_method%3Dpost%26open_id_complete%3D1

Completed in 2708ms (DB: 15) | 302 Found [http://localhost/user_session]

1 个答案:

答案 0 :(得分:0)

大!我得到了它的工作! :)感谢mreinsch的提交。

以下是网址,对于想要启用自动注册的任何人: 此示例应用程序是从@holden示例应用程序分叉的。它还不支持Facebook oid。一旦错误得到修复,我将更新我的回购。

来源: http://github.com/shripadk/authlogic_openid_selector_example/tree/master

直播示例http://testingauth.heroku.com/