Hi,

I am facing problem while using oAuth for gmail access through atom, 2 level
its completed when I try to access gmail atom using oauth_verifier
and oauth_token.
I am getting error "Unauthorized Error 401" anyone guide me how to access
gmail in atom.

headers.
Array ( [0] => GET /gmail/feed/atom HTTP/1.1 [1] => Host: mail.google.com [2]
=> Accept: */* [3] => Authorization: OAuth oauth_version="1.0",
oauth_nonce="e94d4278e756f6fa19a99b35a7b6d83f",
oauth_timestamp="1282571893", oauth_consumer_key="anonymous",
oauth_callback="http%3A%2F%2Flocalhost%2Fsample%2Foauth-php%2Fauth2.php",
oauth_signature_method="HMAC-SHA1",
oauth_signature="3ZGxYpD5hckwXpbjNygkRQqrGG4%3D",
oauth_verifier="4hgTHSV%2FWpbBNL6AtMetR8A%2F",
oauth_token="4%2Fm5nore8_rwOSIwe8xmhR6i45ETEv" )


$header[] = 'GET  /gmail/feed/atom HTTP/1.1';
$header[] = 'Host: mail.google.com';
$header[] = 'Accept: */*';
//$header[] = 'Content-Type: application/x-www-form-urlencoded';
// $header[] = 'Content-Type: application/xml+atom';
$header[] = 'Authorization: OAuth '.$header_string;



$c = curl_init('https://gmail.google.com/gmail/feed/atom');
curl_setopt($c, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($c, CURLOPT_COOKIESESSION, true);
curl_setopt($c, CURLOPT_HTTPHEADER, $header);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 1);
curl_setopt($c, CURLOPT_UNRESTRICTED_AUTH, 1);
curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 1);
echo $str = curl_exec($c);
curl_close($c);

-- 
Thanks & Regards,
P.Benaya Paul

http://www.codeasearch.com
http://www.iwannasearch.com

-- 
You received this message because you are subscribed to the Google Groups 
"OAuth" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/oauth?hl=en.

Reply via email to