class

Google::Auth::ServiceAccountCredentials

Inherits Reference < Object

Service Account (JWT) credentials for server-to-server authentication.

creds = Google::Auth::ServiceAccountCredentials.from_json_key("key.json", scope: Google::Auth::Scopes::YOUTUBE)
youtube = Google::Apis::YoutubeV3::YouTubeService.new
youtube.authorize(creds)

Constants

GOOGLE_TOKEN_URL = "oauth2.googleapis.com"
GRANT_TYPE = "urn:ietf:params:oauth:grant-type:jwt-bearer"
TOKEN_PATH = "/token"

Constructors

from_json_key(json_key_path : String, scope : String | Array(String)) : ServiceAccountCredentials
Source
new(client_email : String, private_key : String, scope : String, token_uri : String = "https://#{GOOGLE_TOKEN_URL}#{TOKEN_PATH}")
Source

Instance methods

access_token
Source
access_token=(access_token : String | Nil)
Source
client_email
Source
client_email=(client_email : String)
Source
expired?
Source
expires_at
Source
expires_at=(expires_at : Time | Nil)
Source
private_key
Source
private_key=(private_key : String)
Source
refresh!
Source
scope
Source
scope=(scope : String)
Source
token_uri
Source
token_uri=(token_uri : String)
Source
valid_token
Source