1.17.8 (latest) 1.17.7 1.16.2 1.15.1 1.14.0 1.13.1 1.12.2 Reference documentation and code samples for the googleauth module Google::Auth::ExternalAccount::BaseCredentials.

Authenticates requests using External Account credentials, such
as those provided by the AWS provider or OIDC provider like Azure, etc.

## Includes

- [Google::Auth::BaseClient](https://docs.cloud.google.com/ruby/docs/reference/googleauth/latest/Google-Auth-BaseClient.md.txt)
- [Google::Auth::Helpers::Connection](https://docs.cloud.google.com/ruby/docs/reference/googleauth/latest/Google-Auth-Helpers-Connection.md.txt)

## Included In

- [Google::Auth::ExternalAccount::AwsCredentials](https://docs.cloud.google.com/ruby/docs/reference/googleauth/latest/Google-Auth-ExternalAccount-AwsCredentials.md.txt)
- [Google::Auth::ExternalAccount::IdentityPoolCredentials](https://docs.cloud.google.com/ruby/docs/reference/googleauth/latest/Google-Auth-ExternalAccount-IdentityPoolCredentials.md.txt)
- [Google::Auth::ExternalAccount::PluggableAuthCredentials](https://docs.cloud.google.com/ruby/docs/reference/googleauth/latest/Google-Auth-ExternalAccount-PluggableAuthCredentials.md.txt)

## Methods

### #access_token

```ruby
def access_token()
```
Returns the value of attribute access_token.

### #access_token=

```ruby
def access_token=(value)
```
Sets the attribute access_token

### #expires_at

```ruby
def expires_at()
```
Returns the value of attribute expires_at.

### #expires_at=

```ruby
def expires_at=(new_expires_at)
```

### #expires_within?

```ruby
def expires_within?(seconds) -> Boolean
```
**Returns**

- (Boolean)

### #fetch_access_token!

```ruby
def fetch_access_token!(_options = {})
```

### #is_workforce_pool?

```ruby
def is_workforce_pool?() -> bool
```
Returns whether the credentials represent a workforce pool (True) or
workload (False) based on the credentials' audience.
**Returns**

- (bool) --- true if the credentials represent a workforce pool. false if they represent a workload.

### #retrieve_subject_token!

```ruby
def retrieve_subject_token!() -> string
```
Retrieves the subject token using the credential_source object.
**Returns**

- (string) --- The retrieved subject token.
**Raises**

- (NoMethodError)

### #universe_domain

```ruby
def universe_domain()
```
Returns the value of attribute universe_domain.

### #universe_domain=

```ruby
def universe_domain=(value)
```
Sets the attribute universe_domain

## Constants

### EXTERNAL_ACCOUNT_JSON_TYPE

**value:** "external_account".freeze  
External account JSON type identifier.

### STS_GRANT_TYPE

**value:** "urn:ietf:params:oauth:grant-type:token-exchange".freeze  
The token exchange grant_type used for exchanging credentials.

### STS_REQUESTED_TOKEN_TYPE

**value:** "urn:ietf:params:oauth:token-type:access_token".freeze  
The token exchange requested_token_type. This is always an access_token.

### IAM_SCOPE

**value:** \["https://www.googleapis.com/auth/iam".freeze\].freeze  
Default IAM_SCOPE