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

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

Authenticates requests using User Refresh credentials.

This class allows authorizing requests from user refresh tokens.

This the end of the result of a 3LO flow. E.g, the end result of 'gcloud auth login' saves a file with these contents in well known location

cf Application Default Credentials

Methods

.make_creds

  def 
  
 self 
 . 
 make_creds 
 ( 
 options 
  
 = 
  
 {}) 
 

Create a UserRefreshCredentials.

Parameters
  • json_key_io(IO) — An IO object containing the JSON key
  • scope(string|array|nil) — the scope(s) to access

.read_json_key

  def 
  
 self 
 . 
 read_json_key 
 ( 
 json_key_io 
 ) 
  
 - 
>  
 Hash 
 

Reads a JSON key from an IO object and extracts required fields.

Parameter
  • json_key_io(IO) — An IO object containing the JSON key
Returns
  • (Hash) — The parsed JSON key
Raises

#duplicate

  def 
  
 duplicate 
 ( 
 options 
  
 = 
  
 {}) 
 

Creates a duplicate of these credentials without the Signet::OAuth2::Client-specific transient state (e.g. cached tokens)

Parameter
  • options(Hash) —

    Overrides for the credentials parameters. The following keys are recognized in addition to keys in the Signet::OAuth2::Client

    • project_id the project id to use during the authentication
    • quota_project_id the quota project id to use during the authentication

#includes_scope?

  def 
  
 includes_scope? 
 ( 
 required_scope 
 ) 
  
 - 
>  
 Boolean 
 

Verifies that a credential grants the requested scope

Parameter
  • required_scope(Array<String>, String) — Scope to verify
Returns
  • (Boolean) — True if scope is granted

#initialize

  def 
  
 initialize 
 ( 
 options 
  
 = 
  
 {}) 
  
 - 
>  
 UserRefreshCredentials 
 
Returns

#project_id

  def 
  
 project_id 
 () 
 

Returns the value of attribute project_id.

#quota_project_id

  def 
  
 quota_project_id 
 () 
 

Returns the value of attribute quota_project_id.

#revoke!

  def 
  
 revoke! 
 ( 
 options 
  
 = 
  
 {}) 
 

Revokes the credential

Parameter
  • options(Hash) — Options for revoking the credential
Raises

#update!

  def 
  
 update! 
 ( 
 options 
  
 = 
  
 {}) 
  
 - 
>  
 Google 
 :: 
 Auth 
 :: 
 UserRefreshCredentials 
 

Destructively updates these credentials

This method is called by Signet::OAuth2::Client 's constructor

Parameter
  • options(Hash) —

    Overrides for the credentials parameters. The following keys are recognized in addition to keys in the Signet::OAuth2::Client

    • project_id the project id to use during the authentication
    • quota_project_id the quota project id to use during the authentication

Constants

TOKEN_CRED_URI

AUTHORIZATION_URI

REVOKE_TOKEN_URI

Create a Mobile Website
View Site in Mobile | Classic
Share by: