Top Level Namespace

Defined Under Namespace

Modules: Google, Signet

Instance Method Summary collapse

Instance Method Details

#read_json_key(json_key_io) ⇒ Object

Reads the private key and client email fields from service account JSON key.



37
38
39
40
41
42
# File 'lib/googleauth/service_account.rb', line 37

def read_json_key(json_key_io)
  json_key = MultiJson.load(json_key_io.read)
  fail 'missing client_email' unless json_key.key?('client_email')
  fail 'missing private_key' unless json_key.key?('private_key')
  [json_key['private_key'], json_key['client_email']]
end