[[["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::GCECredentials (v1.15.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.15.0 (latest)](/ruby/docs/reference/googleauth/latest/Google-Auth-GCECredentials)\n- [1.14.0](/ruby/docs/reference/googleauth/1.14.0/Google-Auth-GCECredentials)\n- [1.13.1](/ruby/docs/reference/googleauth/1.13.1/Google-Auth-GCECredentials)\n- [1.12.2](/ruby/docs/reference/googleauth/1.12.2/Google-Auth-GCECredentials) \nReference documentation and code samples for the googleauth class Google::Auth::GCECredentials.\n\nExtends Signet::OAuth2::Client so that the auth token is obtained from\nthe GCE metadata server. \n\nInherits\n--------\n\n- [Signet::OAuth2::Client](./Signet-OAuth2-Client)\n\nMethods\n-------\n\n### .on_gce?\n\n def self.on_gce?(_options = {}, _reload = false) -\u003e Boolean\n\nDetect if this appear to be a GCE instance, by checking if metadata\nis available.\nThe parameters are deprecated and unused. \n**Returns**\n\n- (Boolean)\n\n### .reset_cache\n\n def self.reset_cache()\n\n**Aliases**\n\n- [.unmemoize_all](./Google-Auth-GCECredentials#Google__Auth__GCECredentials_unmemoize_all_class_)\n\n### .unmemoize_all\n\n def self.unmemoize_all()\n\n**Alias Of** : [.reset_cache](./Google-Auth-GCECredentials#Google__Auth__GCECredentials_reset_cache_class_)\n\n### #duplicate\n\n def duplicate(options = {})\n\nCreates a duplicate of these credentials\nwithout the Signet::OAuth2::Client-specific\ntransient state (e.g. cached tokens) \n**Parameter**\n\n- **options** (Hash) ---\n\n Overrides for the credentials parameters.\n The following keys are recognized in addition to keys in the\n Signet::OAuth2::Client\n - `:universe_domain_overridden` Whether the universe domain was overriden during credentials creation\n\n### #fetch_access_token\n\n def fetch_access_token(_options = {}) -\u003e Hash\n\nOverrides the super class method to change how access tokens are\nfetched. \n**Parameter**\n\n- **_options** (Hash) --- Options for token fetch (not used) \n**Returns**\n\n- (Hash) --- The token data hash \n**Raises**\n\n- ([Google::Auth::UnexpectedStatusError](./Google-Auth-UnexpectedStatusError)) --- On unexpected HTTP status codes\n- ([Google::Auth::AuthorizationError](./Google-Auth-AuthorizationError)) --- If metadata server is unavailable or returns error\n\n### #initialize\n\n def initialize(options = {}) -\u003e GCECredentials\n\nConstruct a GCECredentials \n**Returns**\n\n- ([GCECredentials](./Google-Auth-GCECredentials)) --- a new instance of GCECredentials\n\n### #update!\n\n def update!(options = {}) -\u003e Google::Auth::GCECredentials\n\nDestructively updates these credentials.\n\n\n\u003cbr /\u003e\n\nThis method is called by `Signet::OAuth2::Client`'s constructor \n**Parameter**\n\n- **options** (Hash) ---\n\n Overrides for the credentials parameters.\n The following keys are recognized in addition to keys in the\n Signet::OAuth2::Client\n- `:universe_domain_overridden` Whether the universe domain was overriden during credentials creation \n**Returns**\n\n- ([Google::Auth::GCECredentials](./Google-Auth-GCECredentials))"]]