Hi everyone, Can you help me with Server to Server authentication using OAuth. I registered my application here https://www.google.com/gadgets/directory/verify and get Consumer Key and Consumer Secret. For request generation I use OAuth.php class. I'm trying to get oauth_token, but server's response id: -- Authentication failed Error 401 --
I use following code: require_once('OAuth.php'); define("URI", "http://www.orkut.com"); $request_token_url = URI.'/social/rpc/oauth_get_request_token'; $parsed = parse_url($request_token_url ); $params = array(); $consumer_key = 'orkut.com:802459862591'; $consumer_secret = 'SaFmdnjWL9nf0awK60DJq7zl'; $oauth_consumer = new OAuthConsumer($consumer_key, $consumer_secret, NULL); $req_req = OAuthRequest::from_consumer_and_token($oauth_consumer, NULL, "GET", $request_token_url, $params); $sig_method = new OAuthSignatureMethod_HMAC_SHA1(); $req_req->sign_request($sig_method, $oauth_consumer, NULL); echo $request = $req_req->to_url(); $session = curl_init($request); curl_setopt($session, CURLOPT_RETURNTRANSFER, 1); // Make the request echo $response = curl_exec($session); //Error Handling: // there is an error while executing the request, if (!$response) { $response = curl_error($curl); } curl_close($session); die(); Tell me please what am I doing wrong. Thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Orkut Developer Forum" group. To post to this group, send email to opensocial-orkut@googlegroups.com To unsubscribe from this group, send email to opensocial-orkut+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/opensocial-orkut?hl=en -~----------~----~----~----~------~----~------~--~---