GData API with secure AuthSub

Authsub を secure=1 で
We have a certificate for your domain.
Upload new X.509 cert:
(Optional)

# Generate the RSA keys and certificate
openssl req -x509 -nodes -days 365 -newkey rsa:1024 -sha1 -subj \
‘/C=US/ST=CA/L=Mountain View/CN=www.example.com’ -keyout \
myrsakey.pem -out /tmp/myrsacert.pem
で生成した myrsacert.pem を登録して
zendのclient作成時に myrsakey.pem を設定してあげると警告が消えます!

$client = new Zend_Gdata_HttpClient();
// This sets your private key to be used to sign subsequent requests
$client->setAuthSubPrivateKeyFile('/path/to/myrsakey.pem', null, true);  

$sessionToken = Zend_Gdata_AuthSub::getAuthSubSessionToken(trim($singleUseToken), $client);
// Set the long-lived session token for subsequent requests
$client->setAuthSubToken($sessionToken);

http://code.google.com/intl/ja/apis/gdata/docs/auth/authsub.html#Registered
http://gdatatips.blogspot.com/2008/09/secure-authsub-using-zend-php-library.html
http://www.ibm.com/developerworks/jp/xml/library/x-phpgooglecontact/

無事消えました。

   Yahoo!ブックマークに登録

This entry was posted on 日曜日, 8月 1st, 2010 at 5:32 AM and is filed under Google, api, php. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Comments are closed.