Google_Auth_Simple

Simple API access implementation.

Defined (1)

The class is defined in the following location(s).

/lib/Google/Auth/Simple.php  
  1. class Google_Auth_Simple extends Google_Auth_Abstract 
  2. private $key = null; 
  3. private $client; 
  4.  
  5. public function __construct(Google_Client $client, $config = null) 
  6. $this->client = $client; 
  7.  
  8. /** 
  9. * Perform an authenticated / signed apiHttpRequest. 
  10. * This function takes the apiHttpRequest, calls apiAuth->sign on it 
  11. * (which can modify the request in what ever way fits the auth mechanism) 
  12. * and then calls apiCurlIO::makeRequest on the signed request 
  13. * @param Google_Http_Request $request 
  14. * @return Google_Http_Request The resulting HTTP response including the 
  15. * responseHttpCode, responseHeaders and responseBody. 
  16. */ 
  17. public function authenticatedRequest(Google_Http_Request $request) 
  18. $request = $this->sign($request); 
  19. return $this->io->makeRequest($request); 
  20.  
  21. public function authenticate($code) 
  22. throw new Google_Auth_Exception("Simple auth does not exchange tokens."); 
  23.  
  24. public function setAccessToken($accessToken) 
  25. /** noop*/ 
  26.  
  27. public function getAccessToken() 
  28. return null; 
  29.  
  30. public function createAuthUrl($scope) 
  31. return null; 
  32.  
  33. public function refreshToken($refreshToken) 
  34. /** noop*/ 
  35.  
  36. public function revokeToken() 
  37. /** noop*/ 
  38.  
  39. public function sign(Google_Http_Request $request) 
  40. $key = $this->client->getClassConfig($this, 'developer_key'); 
  41. if ($key) { 
  42. $request->setQueryParam('key', $key); 
  43. return $request;