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 class Google::Auth::IAMCredentials.

Authenticates requests using IAM credentials.

## Inherits

- Object

## Methods

### #apply

```ruby
def apply(a_hash) -> Hash
```
Returns a clone of a_hash updated with the authorization header
**Parameter**

- **a_hash** (Hash) --- The hash to clone and update with credentials
**Returns**

- (Hash) --- A new hash with credentials

### #apply!

```ruby
def apply!(a_hash) -> Hash
```
Adds the credential fields to the hash.
**Parameter**

- **a_hash** (Hash) --- The hash to update with credentials
**Returns**

- (Hash) --- The updated hash with credentials

### #initialize

```ruby
def initialize(selector, token) -> IAMCredentials
```
Initializes an IAMCredentials.
**Parameters**

- **selector** (String) --- The IAM selector.
- **token** (String) --- The IAM token.
**Returns**

- ([IAMCredentials](https://docs.cloud.google.com/ruby/docs/reference/googleauth/latest/Google-Auth-IAMCredentials.md.txt)) --- a new instance of IAMCredentials
**Raises**

- (TypeError) --- If selector or token is not a String

### #updater_proc

```ruby
def updater_proc() -> Proc
```
Returns a reference to the #apply method, suitable for passing as
a closure
**Returns**

- (Proc) --- A procedure that updates a hash with credentials

## Constants

### SELECTOR_KEY

**value:**"x-goog-iam-authority-selector".freeze

### TOKEN_KEY

**value:**"x-goog-iam-authorization-token".freeze