0

在 Ruby 中使用omniauth 和omniauth-openid gem,我正在寻找一种在身份验证期间弹出窗口的方法。

根据 Google 的 OpenID 文档 ( https://developers.google.com/accounts/docs/OpenID),OpenID用户界面 1.0 具有允许弹出式身份验证的设置。

我检查了 ruby​​-openid(它是 omniauth-openid 的依赖项)以确认它已升级为支持 OpenID 用户界面 1.0。

现在我只是想弄清楚最后一块拼图......我假设它会在我的配置设置中的某个地方,目前看起来像这样:

require 'omniauth-openid'
require 'openid/store/filesystem'

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :open_id, :name => 'google', :identifier => 'https://www.google.com/accounts/o8/id'
end

--- 更新:(2013 年 5 月 8 日) ---

所以我破解了 rack-openid gem 以包含 openid ui 扩展,现在我的 URL 如下所示:

https://www.google.com/accounts/o8/ud?openid.ax.if_available=ext4%2Cext5%2Cext6%2Cext7%2Cext8&openid.ax.mode=fetch_request&openid.ax.required=ext0%2Cext1%2Cext2%2Cext3&openid。 ax.type.ext0=http%3A%2F%2Faxschema.org%2Fcontact%2Femail&openid.ax.type.ext1=http%3A%2F%2Faxschema.org%2FnamePerson&openid.ax.type.ext2=http%3A%2F% 2Faxschema.org%2FnamePerson%2Ffirst&openid.ax.type.ext3=http%3A%2F%2Faxschema.org%2FnamePerson%2Flast&openid.ax.type.ext4=http%3A%2F%2Faxschema.org%2FnamePerson%2Ffriendly&openid.ax。 type.ext5=http%3A%2F%2Faxschema.org%2Fcontact%2Fcity%2Fhome&openid.ax.type.ext6=http%3A%2F%2Faxschema.org%2Fcontact%2Fstate%2Fhome&openid.ax.type.ext7=http% 3A%2F%2Faxschema.org%2Fcontact%2Fweb%2Fdefault&openid.ax.type.ext8=http%3A%2F%2Faxschema.org%2Fmedia%2Fimage%2Faspect11&openid。claim_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.ns.ui=http%3A%2F%2Fspecs.openid.net%2Fextensions%2Fui%2F1.0&openid.realm=http%3A%2F%2Flocalhost%3A1999&openid.return_to= http%3A%2F%2Flocalhost%3A1999%2Fauth%2Fgoogle%2Fcallback%3F_method%3Dpost&openid.sreg.optional=postcode%2Cnickname&openid.sreg.required=email%2Cfullname&openid.ui.mode=popupmode=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.ns.ui=http%3A%2F%2Fspecs.openid.net%2Fextensions%2Fui%2F1.0&openid.realm=http%3A%2F% 2Flocalhost%3A1999&openid.return_to=http%3A%2F%2Flocalhost%3A1999%2Fauth%2Fgoogle%2Fcallback%3F_method%3Dpost&openid.sreg.optional=postcode%2Cnickname&openid.sreg.required=email%2Cfullname&openid.ui.mode=popupmode=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.ns.ui=http%3A%2F%2Fspecs.openid.net%2Fextensions%2Fui%2F1.0&openid.realm=http%3A%2F% 2Flocalhost%3A1999&openid.return_to=http%3A%2F%2Flocalhost%3A1999%2Fauth%2Fgoogle%2Fcallback%3F_method%3Dpost&openid.sreg.optional=postcode%2Cnickname&openid.sreg.required=email%2Cfullname&openid.ui.mode=popupreturn_to=http%3A%2F%2Flocalhost%3A1999%2Fauth%2Fgoogle%2Fcallback%3F_method%3Dpost&openid.sreg.optional=postcode%2Cnickname&openid.sreg.required=email%2Cfullname&openid.ui.mode=popupreturn_to=http%3A%2F%2Flocalhost%3A1999%2Fauth%2Fgoogle%2Fcallback%3F_method%3Dpost&openid.sreg.optional=postcode%2Cnickname&openid.sreg.required=email%2Cfullname&openid.ui.mode=popup

所有参数看起来都正确,特别是 openid.ns.ui 参数和 openid.ui.mode 参数;但是,行为没有改变......我做错了什么吗?有什么想法吗?

4

1 回答 1

0

我查看了实际omniauth-openid gem 的源代码,似乎没有添加此功能。尝试提出功能请求。

于 2013-05-07T15:52:28.380 回答