Google Auth Library Client - Class ExternalAccountAuthorizedUserCredentials (1.52.0)

Reference documentation and code samples for the Google Auth Library Client class ExternalAccountAuthorizedUserCredentials.

Authenticates requests using External Account Authorized User credentials.

This class allows authorizing requests from user refresh tokens sourced from external accounts.

Namespace

Google \ Auth \ Credentials

Implements

Methods

__construct

Create a new ExternalAccountAuthorizedUserCredentials.

Parameters
Name Description
scope string|string[]|null

the scope of the access request, expressed either as an Array or as a space-delimited String.

jsonKey array

JSON credential file path or JSON credentials as an associative array

fetchAuthToken

Fetches the auth tokens based on the current state.

Parameters
Name Description
httpHandler callable|null
headers array
Returns
Type Description
array { A set of auth related metadata, containing the following @type string $access_token @type int $expires_in @type string $token_type }

updateMetadata

Updates metadata with the authorization token.

Parameters
Name Description
metadata array

metadata hashmap

authUri string

optional auth uri

httpHandler callable|null

callback which delivers psr7 request

Returns
Type Description
array updated metadata hashmap

getCacheKey

Return the Cache Key for the credentials.

The format for the Cache key is Hash(ClientId.Scope.RefreshToken)

Returns
Type Description
string

getLastReceivedToken

Returns an associative array with the token and expiration time.

Returns
Type Description
array

getQuotaProject

Get the quota project used for this API request

Returns
Type Description
string|null

getUniverseDomain

Get the universe domain used for this API request

Returns
Type Description
string

getGrantedScope

Get the granted scopes (if they exist) for the last fetched token.

Returns
Type Description
string|null