[[["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::UserRefreshCredentials (v1.15.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.15.0 (latest)](/ruby/docs/reference/googleauth/latest/Google-Auth-UserRefreshCredentials)\n- [1.14.0](/ruby/docs/reference/googleauth/1.14.0/Google-Auth-UserRefreshCredentials)\n- [1.13.1](/ruby/docs/reference/googleauth/1.13.1/Google-Auth-UserRefreshCredentials)\n- [1.12.2](/ruby/docs/reference/googleauth/1.12.2/Google-Auth-UserRefreshCredentials) \nReference documentation and code samples for the googleauth class Google::Auth::UserRefreshCredentials.\n\nAuthenticates requests using User Refresh credentials.\n\n\nThis class allows authorizing requests from user refresh tokens.\n\nThis the end of the result of a 3LO flow. E.g, the end result of\n'gcloud auth login' saves a file with these contents in well known\nlocation\n\n\u003cbr /\u003e\n\ncf [Application Default Credentials](https://cloud.google.com/docs/authentication/production) \n\nInherits\n--------\n\n- [Signet::OAuth2::Client](./Signet-OAuth2-Client) \n\nExtended By\n-----------\n\n- [Google::Auth::CredentialsLoader](./Google-Auth-CredentialsLoader)\n\nMethods\n-------\n\n### .make_creds\n\n def self.make_creds(options = {})\n\nCreate a UserRefreshCredentials. \n**Parameters**\n\n- **json_key_io** (IO) --- An IO object containing the JSON key\n- **scope** (string\\|array\\|nil) --- the scope(s) to access\n\n### .read_json_key\n\n def self.read_json_key(json_key_io) -\u003e Hash\n\nReads a JSON key from an IO object and extracts required fields. \n**Parameter**\n\n- **json_key_io** (IO) --- An IO object containing the JSON key \n**Returns**\n\n- (Hash) --- The parsed JSON key \n**Raises**\n\n- ([Google::Auth::InitializationError](./Google-Auth-InitializationError)) --- If the JSON is missing required fields\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 - `project_id` the project id to use during the authentication\n - `quota_project_id` the quota project id to use during the authentication\n\n### #includes_scope?\n\n def includes_scope?(required_scope) -\u003e Boolean\n\nVerifies that a credential grants the requested scope \n**Parameter**\n\n- **required_scope** (Array\\\u003cString\\\u003e, String) --- Scope to verify \n**Returns**\n\n- (Boolean) --- True if scope is granted\n\n### #initialize\n\n def initialize(options = {}) -\u003e UserRefreshCredentials\n\n**Returns**\n\n- ([UserRefreshCredentials](./Google-Auth-UserRefreshCredentials)) --- a new instance of UserRefreshCredentials\n\n### #project_id\n\n def project_id()\n\nReturns the value of attribute project_id.\n\n### #quota_project_id\n\n def quota_project_id()\n\nReturns the value of attribute quota_project_id.\n\n### #revoke!\n\n def revoke!(options = {})\n\nRevokes the credential \n**Parameter**\n\n- **options** (Hash) --- Options for revoking the credential \n**Raises**\n\n- ([Google::Auth::AuthorizationError](./Google-Auth-AuthorizationError)) --- If the revocation request fails\n\n### #update!\n\n def update!(options = {}) -\u003e Google::Auth::UserRefreshCredentials\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 - `project_id` the project id to use during the authentication\n- `quota_project_id` the quota project id to use during the authentication \n**Returns**\n\n- ([Google::Auth::UserRefreshCredentials](./Google-Auth-UserRefreshCredentials))\n\nConstants\n---------\n\n### TOKEN_CRED_URI\n\n**value:** \"\u003chttps://oauth2.googleapis.com/token\".freeze\u003e\n\n### AUTHORIZATION_URI\n\n**value:** \"\u003chttps://accounts.google.com/o/oauth2/auth\".freeze\u003e\n\n### REVOKE_TOKEN_URI\n\n**value:** \"\u003chttps://oauth2.googleapis.com/revoke\".freeze\u003e"]]