Check the oauth playground source code here

http://gdata-samples.googlecode.com/svn-history/r198/trunk/oauth_playground/

It should solve all your troubles. Solved mine.

On Dec 4, 4:19 pm, Pushpa <[email protected]> wrote:
> Hi
>
> I am bot able to get AuthSubRevokeToken
> Below is my script
>
> step1.php
>
> <?
> $secure = 0;
> $session = 1;
> $scope = 'http://www.google.com/m8/feeds/';
> $next = "http://{$_SERVER['HTTP_HOST']}{$_SERVER['PHP_SELF']}";
>
> $token = @$_GET['token'];  // only a single use token
> $sessionToken = AuthSubSessionToken($token);
>
> if(!$token)
> {
> echo "<a href=\"https://www.google.com/accounts/AuthSubRequest?scope=
> $scope&session=$session&secure=$secure&next=$next\">Sign in to Google</
> a>";
> exit;}
>
> else
> {
> header('location:step2.php?token='.$token.'&session_token='.
> $sessionToken);
>
> }
>
> function AuthSubSessionToken($token) {
> $ch = curl_init("https://www.google.com/accounts/
> AuthSubSessionToken");
> curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
> curl_setopt($ch, CURLOPT_FAILONERROR, true);
> curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
> curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: AuthSub
> token="' . trim($token) . '"'));
>
> $result = curl_exec($ch);
> curl_close($ch);
> $splitStr = split("=", $result);
>
> return trim($splitStr[1]);
>
> }
>
> ?>
>
> step2.php
>
>     <?
>     $secure = 0;
>     $session = 1;
>     $scope = 'http://www.google.com/m8/feeds/';
>     $next = "http://{$_SERVER['HTTP_HOST']}{$_SERVER['PHP_SELF']}";
>
>     $token = $_GET['token'];  // only a single use token
>     $sessionToken = $_GET['session_token'];  // only a single use
> token
>
>    $AuthSubRevokeToken = AuthSubRevokeToken($sessionToken);
>    $AuthSubTokenInfo = AuthSubTokenInfo($token);
>
>    function AuthSubRevokeToken($token) {
>      $ch = curl_init("https://www.google.com/accounts/
> AuthSubRevokeToken");
>      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
>      curl_setopt($ch, CURLOPT_FAILONERROR, true);
>      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
>      curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization:
> AuthSub token="'.$token.'"'));
>
>      $result = curl_exec($ch);
>      curl_close($ch);
>   echo '<br>AuthSubRevokeToken= '.$result.'<br><br><br>';
>      $splitStr = split("=", $result);
>
>      //return trim($splitStr[1]);
>    }
>    function AuthSubTokenInfo($token) {
>      $ch = curl_init("https://www.google.com/accounts/
> AuthSubTokenInfo");
>      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
>      curl_setopt($ch, CURLOPT_FAILONERROR, true);
>      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
>      curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization:
> AuthSub token="' . trim($token) . '"'));
>
>      $result = curl_exec($ch);
>      curl_close($ch);
>    echo '<br>AuthSubTokenInfo= '.$result.'<br><br><br>';
>      $splitStr = split("=", $result);
>
>      return trim($splitStr[1]);
>    }
>    ?>

--

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