Class Google::Auth::UserRefreshCredentials
In: lib/googleauth/user_refresh.rb
Parent: Signet::OAuth2::Client

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](goo.gl/mkAHpZ)

Methods

Constants

TOKEN_CRED_URI = "https://oauth2.googleapis.com/token".freeze
AUTHORIZATION_URI = "https://accounts.google.com/o/oauth2/auth".freeze
REVOKE_TOKEN_URI = "https://oauth2.googleapis.com/revoke".freeze

Attributes

project_id  [R] 

Public Class methods

Create a UserRefreshCredentials.

@param json_key_io [IO] an IO from which the JSON key can be read @param scope [string|array|nil] the scope(s) to access

Reads the client_id, client_secret and refresh_token fields from the JSON key.

Public Instance methods

Verifies that a credential grants the requested scope

@param [Array<String>, String] required_scope

 Scope to verify

@return [Boolean]

 True if scope is granted

Revokes the credential

[Validate]