2010-01-02 81 views
0

好吧,我在G'oogle的联合登录中获得了更多的运气,我正好从Google获得以下参数。如何签署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] => [email protected] 
[openid_ext1_type_lastname] => http://axschema.org/namePerson/last 
[openid_ext1_value_lastname] => MySurname 

我现在需要做的唯一的事情就是签名和”如果我没有理解这个正确的谷歌是给我用[openid_signed]

即一个线索:字符串的PARAMS在一起,然后创建哈希出级联〜应变的应该等于[openid_sig] => tUZtUtVcvOfrodpPEx4bItcxVME =

但是我相信还有更多的签名生成公式 - 任何人都知道它是什么,因为我不能找到它在谷歌的文档anyw这里?

回答

0

您可以使用JanRain的RPX-Now进行相同的操作。它有一个更简单,并允许几乎所有的OpenID提供者。 https://rpxnow.com/

+0

谢谢 - 但janRain不适合我的项目范围(基本上我不喜欢它)这就是为什么我写我自己的,目前它只有100行代码,这对于项目和我。 – 2010-01-02 15:22:59

0

谷歌联合登录是,有一些小的变化,OpenID。不要在Google联合登录的签名协议上查找文档,请查找有关how to generate a signaturehow to verify the signature的信息。

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