[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# googleauth - Class Google::Auth::IAMCredentials (v1.15.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.15.0 (latest)](/ruby/docs/reference/googleauth/latest/Google-Auth-IAMCredentials)\n- [1.14.0](/ruby/docs/reference/googleauth/1.14.0/Google-Auth-IAMCredentials)\n- [1.13.1](/ruby/docs/reference/googleauth/1.13.1/Google-Auth-IAMCredentials)\n- [1.12.2](/ruby/docs/reference/googleauth/1.12.2/Google-Auth-IAMCredentials) \nReference documentation and code samples for the googleauth class Google::Auth::IAMCredentials.\n\nAuthenticates requests using IAM credentials. \n\nInherits\n--------\n\n- Object\n\nMethods\n-------\n\n### #apply\n\n def apply(a_hash) -\u003e Hash\n\nReturns a clone of a_hash updated with the authorization header \n**Parameter**\n\n- **a_hash** (Hash) --- The hash to clone and update with credentials \n**Returns**\n\n- (Hash) --- A new hash with credentials\n\n### #apply!\n\n def apply!(a_hash) -\u003e Hash\n\nAdds the credential fields to the hash. \n**Parameter**\n\n- **a_hash** (Hash) --- The hash to update with credentials \n**Returns**\n\n- (Hash) --- The updated hash with credentials\n\n### #initialize\n\n def initialize(selector, token) -\u003e IAMCredentials\n\nInitializes an IAMCredentials. \n**Parameters**\n\n- **selector** (String) --- The IAM selector.\n- **token** (String) --- The IAM token. \n**Returns**\n\n- ([IAMCredentials](./Google-Auth-IAMCredentials)) --- a new instance of IAMCredentials \n**Raises**\n\n- (TypeError) --- If selector or token is not a String\n\n### #updater_proc\n\n def updater_proc() -\u003e Proc\n\nReturns a reference to the #apply method, suitable for passing as\na closure \n**Returns**\n\n- (Proc) --- A procedure that updates a hash with credentials\n\nConstants\n---------\n\n### SELECTOR_KEY\n\n**value:**\"x-goog-iam-authority-selector\".freeze\n\n### TOKEN_KEY\n\n**value:**\"x-goog-iam-authorization-token\".freeze"]]