2010-01-02 79 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函數似乎是驗證簽名的代碼開始的地方。