0

好的,我对 G'oogle 的联合登录有更多的运气,我正处于您从 Google 获得以下参数的地步。

[openid_ns] => http://specs.openid.net/auth/2.0
[openid_mode] => id_res
[openid_op_endpoint] => https://www.google.com/accounts/o8/ud
[openid_response_nonce] => 2010-01-02T14:58:22ZvP-t8tJXqGWaPw
[openid_return_to] => http://localhost/blablabla/index.php?c=google
[openid_assoc_handle] => AOQobUdTUUFVqQ9PeC9r19-rHOlEg_xvFmiIUahkmhNQ7Blrh14w2-eb
[openid_signed] => op_endpoint,claimed_id,identity,return_to,response_nonce,assoc_handle,ns.ext1,ext1.mode,ext1.type.firstname,ext1.value.firstname,ext1.type.email,ext1.value.email,ext1.type.lastname,ext1.value.lastname
[openid_sig] => tUZtUtVcvOfrodpPEx4bItcxVME=
[openid_identity] => https://www.google.com/accounts/o8/id?id=xxxxxxxxxxxxxxxxxx
[openid_claimed_id] => https://www.google.com/accounts/o8/id?id=xxxxxxxxxxxxxxxxxx
[openid_ns_ext1] => http://openid.net/srv/ax/1.0
[openid_ext1_mode] => fetch_response
[openid_ext1_type_firstname] => http://axschema.org/namePerson/first
[openid_ext1_value_firstname] => myName
[openid_ext1_type_email] => http://axschema.org/contact/email
[openid_ext1_value_email] => user@gmail.com
[openid_ext1_type_lastname] => http://axschema.org/namePerson/last
[openid_ext1_value_lastname] => MySurname

我现在唯一需要做的就是签名并且'如果我理解正确,谷歌会给我一个 [openid_signed] 的线索

即:将这些参数串在一起,然后从连接的字符串中创建散列应该等于[openid_sig] => tUZtUtVcvOfrodpPEx4bItcxVME=

但我确定签名生成公式还有更多内容 - 任何人都知道它是什么,因为我无法在任何地方的 Google 文档中找到它?

4

2 回答 2

0

Google Federated Login 是 OpenID,只是做了一些小改动。与其查找有关 Google Federated Login 签名协议的文档,不如查找有关如何生成签名以及如何验证签名的信息。

即使您不想使用 JanRain 代码,您仍然可以通过查看代码获得这些问题的一些答案。例如,第verify1320 行的函数/Auth/OpenID/Server.php似乎是验证签名的代码开始的地方。

于 2010-01-02T21:53:49.090 回答
0

您也可以使用 JanRain 的 RPX-Now。它有一个更简单的并且允许几乎所有的 OpenID 提供者。https://rpxnow.com/

于 2010-01-02T15:15:10.943 回答