Class Google::Auth::ServiceAccountCredentials
In: lib/googleauth/service_account.rb
Parent: Signet::OAuth2::Client

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’).

cf [Application Default Credentials](goo.gl/mkAHpZ)

Methods

apply!   make_creds   new   unescape  

Constants

TOKEN_CRED_URI = "https://www.googleapis.com/oauth2/v4/token".freeze

Attributes

project_id  [R] 

Public Class methods

Creates a ServiceAccountCredentials.

@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

Handles certain escape sequences that sometimes appear in input. Specifically, interprets the "\n" sequence for newline, and removes enclosing quotes.

Public Instance methods

Extends the base class.

If scope(s) is not set, it creates a transient ServiceAccountJwtHeaderCredentials instance and uses that to authenticate instead.

[Validate]