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::ExternalAccountUtils.

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

## 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

### #normalize_timestamp

```ruby
def normalize_timestamp(time) -> Time, nil
```
Normalizes a timestamp value to a Time object
**Parameter**

- **time** (Time, String, nil) --- The timestamp to normalize
**Returns**

- (Time, nil) --- The normalized timestamp or nil if input is nil
**Raises**

- ([Google::Auth::CredentialsError](https://docs.cloud.google.com/ruby/docs/reference/googleauth/latest/Google-Auth-CredentialsError.md.txt)) --- If the time value is not nil, Time, or String

### #project_id

```ruby
def project_id() -> String, nil
```
Retrieves the project ID corresponding to the workload identity or workforce pool.
For workforce pool credentials, it returns the project ID corresponding to the workforce_pool_user_project.
When not determinable, None is returned.


<br />

The resource may not have permission (resourcemanager.projects.get) to
call this API or the required scopes may not be selected:
<https://cloud.google.com/resource-manager/reference/rest/v1/projects/get#authorization-scopes>
**Returns**

- (String, nil) --- The project ID corresponding to the workload identity pool or workforce pool if determinable

### #project_number

```ruby
def project_number() -> String, nil
```
Retrieve the project number corresponding to workload identity pool
STS audience pattern:
`//iam.googleapis.com/projects/$PROJECT_NUMBER/locations/...`
**Returns**

- (String, nil) --- The project number extracted from the audience string, or nil if it cannot be determined

### #service_account_email

```ruby
def service_account_email() -> String, nil
```
Extracts the service account email from the impersonation URL
**Returns**

- (String, nil) --- The service account email extracted from the service_account_impersonation_url, or nil if it cannot be determined

## Constants

### CLOUD_RESOURCE_MANAGER

**value:** "<https://cloudresourcemanager.googleapis.com/v1/projects/".freeze>  
Cloud resource manager URL used to retrieve project information.