我可能失去了一些东西真的傻了,错过了Google Federated Login文档中,但如何在谷歌OpenID登录实际上确保对请求的网站?请求网站如何知道细节来自Google,而不仅仅是有人在URL中输入查询字符串参数?保护的谷歌的OpenID细节潜在欺骗到请求站点
为了说明这一点,我在PHP中实现了一个基本的OpenID登录序列,并且所有似乎返回的结果都是URL中的一串查询字符串参数,我可以使用它来获取OpenID详细信息,这非常有效。问题是,如果我只是手动输入到地址栏而没有实际登录Google,我的请求站点如何知道它们的区别?
首先,形式请求细节:
<form method='post' action='https://www.google.com/accounts/o8/ud'>
<input type='hidden' name='openid.return_to' value='http://www.example/com/logged-in' />
<input type='hidden' name='openid.mode' value='checkid_setup' />
<input type='hidden' name='openid.ns' value='http://specs.openid.net/auth/2.0' />
<input type='hidden' name='openid.claimed_id' value='http://specs.openid.net/auth/2.0/identifier_select' />
<input type='hidden' name='openid.identity' value='http://specs.openid.net/auth/2.0/identifier_select' />
<input type='hidden' name='openid.ns.ax' value='http://openid.net/srv/ax/1.0' />
<input type='hidden' name='openid.ax.mode' value='fetch_request' />
<input type='hidden' name='openid.ax.required' value='email,firstname,lastname' />
<input type='hidden' name='openid.ax.type.email' value='http://axschema.org/contact/email' />
<input type='hidden' name='openid.ax.type.firstname' value='http://axschema.org/namePerson/first' />
<input type='hidden' name='openid.ax.type.lastname' value='http://axschema.org/namePerson/last' />
<input type='submit' value='Login With Google Account' />
</form>
...伟大的工程,有一大堆的URL参数,如下图所示送我回请求站点http://www.example.com/logged-in
(从PHP print_r
调用):
Array
(
[openid_ns] => http://specs.openid.net/auth/2.0
[openid_mode] => id_res
[openid_return_to] => http://www.example.com/logged-in
[openid_ext1_type_firstname] => http://axschema.org/namePerson/first
[openid_ext1_value_firstname] => {user's first name}
[openid_ext1_type_email] => http://axschema.org/contact/email
[openid_ext1_value_email] => {user's e-mail address}
[openid_ext1_type_lastname] => http://axschema.org/namePerson/last
[openid_ext1_value_lastname] => {user's last name}
)
...这是真棒,但我怎么知道,这其实就是一个合法的要求,而不是有人在上面的参数输入到地址栏?
感谢您的帮助,道歉,如果这已被要求已经(找不到任何副本!),如果我失去了一些东西明显!
只是不?真的吗?你知道你让我想更多地调查这个,对吗? ; P我最近遇到了另一个利用OpenID的方面,特别是Google登录,称为'nonce'。基本上只使用一次的随机数,这些随机数的可以用来帮助保护认证,但它仍然看起来像一个狂热的黑客可以在上面和伪造仍然跳自己的方式。感谢您抽出宝贵时间来回应史蒂夫! – 2012-01-27 09:40:14