class ExternalAccountCredentials implements FetchAuthTokenInterface, UpdateMetadataInterface (View source)

Traits

Provides shared methods for updating request metadata (request headers).

Constants

private EXTERNAL_ACCOUNT_TYPE

Methods

callable
getUpdateMetadataFunc() deprecated

export a callback function which updates runtime metadata.

array
updateMetadata(array $metadata, string $authUri = null, callable $httpHandler = null)

Updates metadata with the authorization token.

__construct(string|string[] $scope, array $jsonKey)

No description

array
fetchAuthToken(callable $httpHandler = null)

No description

string
getCacheKey()

Obtains a key that can used to cache the results of #fetchAuthToken.

null|array
getLastReceivedToken()

Returns an associative array with the token and expiration time.

Details

callable getUpdateMetadataFunc() deprecated

deprecated

export a callback function which updates runtime metadata.

Return Value

callable

updateMetadata function

array updateMetadata(array $metadata, string $authUri = null, callable $httpHandler = null)

Updates metadata with the authorization token.

Parameters

array $metadata

metadata hashmap

string $authUri

optional auth uri

callable $httpHandler

callback which delivers psr7 request

Return Value

array

updated metadata hashmap

__construct(string|string[] $scope, array $jsonKey)

No description

Parameters

string|string[] $scope

The scope of the access request, expressed either as an array or as a space-delimited string.

array $jsonKey

JSON credentials as an associative array.

array fetchAuthToken(callable $httpHandler = null)

No description

Parameters

callable $httpHandler

callback which delivers psr7 request

Return Value

array

a hash of auth tokens

string getCacheKey()

Obtains a key that can used to cache the results of #fetchAuthToken.

If the value is empty, the auth token is not cached.

Return Value

string

a key that may be used to cache the auth token.

null|array getLastReceivedToken()

Returns an associative array with the token and expiration time.

Return Value

null|array

{ The last received access token.

@type string $access_token The access token string.
@type int $expires_at The time the token expires as a UNIX timestamp.

}