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

发布于 2024-09-02 05:53:09 字数 3041 浏览 5 评论 0原文

这是一个非常奇怪的问题:我已经设置了 authlogic_openid_selector_example 应用。当我注册时,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]

This is a really weird problem: I have set up the authlogic_openid_selector_example app. When i register, the email id is not returned by the openid provider the first time. But if i delete the account and register again, the email id is returned. How do i fix this problem? I have hosted my version of the app here: http://pingauthtest.heroku.com/

I looked at my development log and the first time the provider doesn't return the openid.ext1.value.ext0 which contains the email id. This is returned the second time only after having deleted the account first.

Edit: Some extra info for debugging:

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]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凉薄对峙 2024-09-09 05:53:09

伟大的!我已经开始工作了!! :) 感谢 mreinsch 的提交。

以下是 URL,供任何想要启用自动注册的人使用:
此示例应用程序是从 @holden 示例应用程序分叉的。它还不支持 Facebook oid。一旦错误修复,我将更新我的存储库。

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

实例http://testingauth.heroku.com/< /a>

Great! I got it to work!! :) Thanks to a commit by mreinsch.

Here is the URL, For anyone who wants to have auto-registration enabled:
This example app is forked from @holden example app. It does not support the Facebook oid yet. Once the bug is fixed i shall update my repo.

Source: http://github.com/shripadk/authlogic_openid_selector_example/tree/master

Live Example: http://testingauth.heroku.com/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文