Class Google::Auth::ClientId
In: lib/googleauth/client_id.rb
Parent: Object

Representation of an application‘s identity for user authorization flows.

Methods

from_file   from_hash   new  

Constants

INSTALLED_APP = "installed".freeze
WEB_APP = "web".freeze
CLIENT_ID = "client_id".freeze
CLIENT_SECRET = "client_secret".freeze
MISSING_TOP_LEVEL_ELEMENT_ERROR = "Expected top level property 'installed' or 'web' to be present.".freeze

Attributes

default  [RW] 
id  [R]  Text identifier of the client ID @return [String]
secret  [R]  Secret associated with the client ID @return [String]

Public Class methods

Constructs a Client ID from a JSON file downloaded from the Google Developers Console.

@param [String, File] file

 Path of file to read from

@return [Google::Auth::ClientID]

Constructs a Client ID from a previously loaded JSON file. The hash structure should match the expected JSON format.

@param [hash] config

 Parsed contents of the JSON file

@return [Google::Auth::ClientID]

Initialize the Client ID

@param [String] id

 Text identifier of the client ID

@param [String] secret

 Secret associated with the client ID

@note Direction instantion is discouraged to avoid embedding IDs

      & secrets in source. See {#from_file} to load from
      `client_secrets.json` files.

[Validate]