Reference documentation and code samples for the googleauth class Google::Auth::ServiceAccountCredentials.
Authenticates requests using Google's Service Account credentials via an OAuth access token.
This class allows authorizing requests for service accounts directly from credentials from a json key file downloaded from the developer console (via 'Generate new Json Key').
Inherits
Methods
.make_creds
def self.make_creds(options = {})
Creates a ServiceAccountCredentials.
- json_key_io (IO) — an IO from which the JSON key can be read
- scope (string|array|nil) — the scope(s) to access
- (ArgumentError)
.unescape
def self.unescape(str)
Handles certain escape sequences that sometimes appear in input. Specifically, interprets the "\n" sequence for newline, and removes enclosing quotes.
#apply!
def apply!(a_hash, opts = {})
Extends the base class to use a transient ServiceAccountJwtHeaderCredentials for certain cases.
#enable_self_signed_jwt?
def enable_self_signed_jwt?() -> Boolean
- (Boolean)
#initialize
def initialize(options = {}) -> ServiceAccountCredentials
- (ServiceAccountCredentials) — a new instance of ServiceAccountCredentials
#needs_access_token?
def needs_access_token?() -> Boolean
Modifies this logic so it also requires self-signed-jwt to be disabled
- (Boolean)
#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.