Reference documentation and code samples for the googleauth module Google::Auth::BaseClient.
BaseClient is a class used to contain common methods that are required by any
Credentials Client, including AwsCredentials, ServiceAccountCredentials,
and UserRefreshCredentials. This is a superclass of Signet::OAuth2::Client
and has been created to create a generic interface for all credentials clients
to use, including ones which do not inherit from Signet::OAuth2::Client.
Methods
#apply
defapply(a_hash,opts={})
Returns a clone of a_hash updated with the authentication token
#apply!
defapply!(a_hash,opts={})
Updates a_hash updated with the authentication token
#expires_within?
defexpires_within?()->Boolean
Returns
(Boolean)
Raises
(NoMethodError)
#logger
deflogger()
The logger used to log operations on this client, such as token refresh.
#logger=
deflogger=(value)
The logger used to log operations on this client, such as token refresh.
#needs_access_token?
defneeds_access_token?()->Boolean
Whether the id_token or access_token is missing or about to expire.
Returns
(Boolean)
#notify_refresh_listeners
defnotify_refresh_listeners()
#on_refresh
defon_refresh(&block)
#updater_proc
defupdater_proc()
Returns a reference to the #apply method, suitable for passing as
a closure
[[["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 - Module Google::Auth::BaseClient (v1.15.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.15.0 (latest)](/ruby/docs/reference/googleauth/latest/Google-Auth-BaseClient)\n- [1.14.0](/ruby/docs/reference/googleauth/1.14.0/Google-Auth-BaseClient)\n- [1.13.1](/ruby/docs/reference/googleauth/1.13.1/Google-Auth-BaseClient)\n- [1.12.2](/ruby/docs/reference/googleauth/1.12.2/Google-Auth-BaseClient) \nReference documentation and code samples for the googleauth module Google::Auth::BaseClient.\n\nBaseClient is a class used to contain common methods that are required by any\nCredentials Client, including AwsCredentials, ServiceAccountCredentials,\nand UserRefreshCredentials. This is a superclass of Signet::OAuth2::Client\nand has been created to create a generic interface for all credentials clients\nto use, including ones which do not inherit from Signet::OAuth2::Client.\n\nMethods\n-------\n\n### #apply\n\n def apply(a_hash, opts = {})\n\nReturns a clone of a_hash updated with the authentication token\n\n### #apply!\n\n def apply!(a_hash, opts = {})\n\nUpdates a_hash updated with the authentication token\n\n### #expires_within?\n\n def expires_within?() -\u003e Boolean\n\n**Returns**\n\n- (Boolean) \n**Raises**\n\n- (NoMethodError)\n\n### #logger\n\n def logger()\n\nThe logger used to log operations on this client, such as token refresh.\n\n### #logger=\n\n def logger=(value)\n\nThe logger used to log operations on this client, such as token refresh.\n\n### #needs_access_token?\n\n def needs_access_token?() -\u003e Boolean\n\nWhether the id_token or access_token is missing or about to expire. \n**Returns**\n\n- (Boolean)\n\n### #notify_refresh_listeners\n\n def notify_refresh_listeners()\n\n### #on_refresh\n\n def on_refresh(&block)\n\n### #updater_proc\n\n def updater_proc()\n\nReturns a reference to the #apply method, suitable for passing as\na closure\n\nConstants\n---------\n\n### AUTH_METADATA_KEY\n\n**value:**:authorization"]]