googleauth - Class Google::Auth::IAMCredentials (v1.15.0)

Reference documentation and code samples for the googleauth class Google::Auth::IAMCredentials.

Authenticates requests using IAM credentials.

Inherits

  • Object

Methods

#apply

defapply(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!

defapply!(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

definitialize(selector,token)->IAMCredentials

Initializes an IAMCredentials.

Parameters
  • selector (String) — The IAM selector.
  • token (String) — The IAM token.
Returns
Raises
  • (TypeError) — If selector or token is not a String

#updater_proc

defupdater_proc()->Proc

Returns a reference to the #apply method, suitable for passing asa 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

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-10-30 UTC.