class
Google::Auth::ServiceAccountCredentials
- Google::Auth::ServiceAccountCredentials
- Reference
- Object
Overview
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)
Defined in:
google/auth/service_account.crConstant Summary
-
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
- .new(client_email : String, private_key : String, scope : String, token_uri : String = "https://#{GOOGLE_TOKEN_URL}#{TOKEN_PATH}")
Instance Method Summary
- #access_token : String | Nil
- #access_token=(access_token : String | Nil)
- #client_email : String
- #client_email=(client_email : String)
- #expired? : Bool
- #expires_at : Time | Nil
- #expires_at=(expires_at : Time | Nil)
- #private_key : String
- #private_key=(private_key : String)
- #refresh! : String
- #scope : String
- #scope=(scope : String)
- #token_uri : String
- #token_uri=(token_uri : String)
- #valid_token : String
Constructor Detail
def self.from_json_key(json_key_path : String, scope : String | Array(String)) : ServiceAccountCredentials
#
def self.new(client_email : String, private_key : String, scope : String, token_uri : String = "https://#{GOOGLE_TOKEN_URL}#{TOKEN_PATH}")
#