Google Auth Library Client - Class AwsNativeSource (1.45.2)

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

Authenticates requests using AWS credentials.

Namespace

Google \ Auth \ CredentialSource

Methods

__construct

Parameters
Name Description
audience string

The audience for the credential.

regionalCredVerificationUrl string

The regional AWS GetCallerIdentity action URL used to determine the AWS account ID and its roles. This is not called by this library, but is sent in the subject token to be called by the STS token server.

regionUrl string|null

This URL should be used to determine the current AWS region needed for the signed request construction.

securityCredentialsUrl string|null

The AWS metadata server URL used to retrieve the access key, secret key and security token needed to sign the GetCallerIdentity request.

imdsv2SessionTokenUrl string|null

Presence of this URL enforces the auth libraries to fetch a Session Token from AWS. This field is required for EC2 instances using IMDSv2.

fetchSubjectToken

Parameter
Name Description
httpHandler ?callable

getCacheKey

Gets the unique key for caching For AwsNativeSource the values are: Imdsv2SessionTokenUrl.SecurityCredentialsUrl.RegionUrl.RegionalCredVerificationUrl

Returns
Type Description
string

static::getImdsV2SessionToken

Parameters
Name Description
imdsV2Url string
httpHandler callable

static::getSignedRequestHeaders

Parameters
Name Description
region string
host string
accessKeyId string
secretAccessKey string
securityToken ?string
Returns
Type Description
array

static::getRegionFromEnv

static::getRegionFromUrl

Parameters
Name Description
httpHandler callable
regionUrl string
headers array

Request headers to send in with the request.

static::getRoleName

Parameters
Name Description
httpHandler callable
securityCredentialsUrl string
headers array

Request headers to send in with the request.

static::getSigningVarsFromUrl

Parameters
Name Description
httpHandler callable
securityCredentialsUrl string
roleName string
headers array

Request headers to send in with the request.

Returns
Type Description
array{: string, : string, : ?string}

static::getSigningVarsFromEnv

Returns
Type Description
array{: string, : string, : ?string}