Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Differences Between: [Versions 310 and 402] [Versions 311 and 402] [Versions 39 and 402] [Versions 400 and 402] [Versions 401 and 402]

(no description)

File Size: 147 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Google_Auth_ComputeEngine:: (7 methods):
  __construct()
  authenticatedRequest()
  setAccessToken()
  getAccessToken()
  acquireAccessToken()
  sign()
  isAccessTokenExpired()


Class: Google_Auth_ComputeEngine  - X-Ref

Authentication via built-in Compute Engine service accounts.
The instance must be pre-configured with a service account
and the appropriate scopes.

__construct(Google_Client $client, $config = null)   X-Ref
No description

authenticatedRequest(Google_Http_Request $request)   X-Ref
Perform an authenticated / signed apiHttpRequest.
This function takes the apiHttpRequest, calls apiAuth->sign on it
(which can modify the request in what ever way fits the auth mechanism)
and then calls apiCurlIO::makeRequest on the signed request

param: Google_Http_Request $request
return: Google_Http_Request The resulting HTTP response including the

setAccessToken($token)   X-Ref

param: string $token

getAccessToken()   X-Ref
No description

acquireAccessToken()   X-Ref
Acquires a new access token from the compute engine metadata server.


sign(Google_Http_Request $request)   X-Ref
Include an accessToken in a given apiHttpRequest.

param: Google_Http_Request $request
return: Google_Http_Request

isAccessTokenExpired()   X-Ref
Returns if the access_token is expired.

return: bool Returns True if the access_token is expired.