Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogle latitude returns empty location resource. Anything wrong in this Oauth flow?
    primarykey
    data
    text
    <p>using examples I have this code. It works fine, authorizes the proper scopes and everything:</p> <pre><code>&lt;?php ini_set("display_errors",1); error_reporting(E_ALL); session_start(); set_include_path('/home/library/'.get_include_path()); require_once 'Zend/Oauth/Consumer.php'; $oauthOptions = array( 'requestScheme' =&gt; Zend_Oauth::REQUEST_SCHEME_HEADER, 'version' =&gt; '1.0', 'consumerKey' =&gt; 'ivana.2x.to', 'consumerSecret' =&gt; '*********', 'signatureMethod' =&gt; 'HMAC-SHA1', 'requestTokenUrl' =&gt; 'https://www.google.com/accounts/OAuthGetRequestToken', 'userAuthorizationUrl' =&gt; 'https://www.google.com/latitude/apps/OAuthAuthorizeToken', 'accessTokenUrl' =&gt; 'https://www.google.com/accounts/OAuthGetAccessToken', 'callbackUrl' =&gt; 'http://ivana.2x.to/geo/?show=callback', ); $consumer = new Zend_Oauth_Consumer($oauthOptions); if (!isset($_SESSION['ACCESS_TOKEN_GOOGLE'])) { if (!empty($_GET)) { $token = $consumer-&gt;getAccessToken($_GET, unserialize($_SESSION['REQUEST_TOKEN_GOOGLE'])); $_SESSION['ACCESS_TOKEN_GOOGLE'] = serialize($token); } else { $token = $consumer-&gt;getRequestToken(array('scope'=&gt;'https://www.googleapis.com/auth/latitude')); $_SESSION['REQUEST_TOKEN_GOOGLE'] = serialize($token); $customparams = array('domain' =&gt; 'ivana.2x.to', 'granularity' =&gt; 'best', 'location' =&gt; 'current'); $consumer-&gt;redirect($customparams ); exit; } } else { $token = unserialize($_SESSION['ACCESS_TOKEN_GOOGLE']); //$_SESSION['ACCESS_TOKEN_GOOGLE'] = null; // do not use, we want to keep the access token } $client = $token-&gt;getHttpClient($oauthOptions); $client-&gt;setUri('https://www.googleapis.com/latitude/v1/currentLocation'); $client-&gt;setMethod(Zend_Http_Client::GET); $response = $client-&gt;request(); $body = $response-&gt;getBody(); header('Content-Type: ' . $response-&gt;getHeader('Content-Type')); echo $response-&gt;getBody(); </code></pre> <p>No my problem is that i get an empty location resource. It just looks like this:</p> <pre><code>{"data":{"kind":"latitude#location"}} </code></pre> <p>The data is missing. But no error or anything.</p> <p>I am logged in and my location is set and google guarantees lon and lat to be returned. </p> <p>Any ideas?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload