Class: GlobusClient::Authenticator

Inherits:
Object
  • Object
show all
Defined in:
lib/globus_client/authenticator.rb

Overview

The namespace for the "login" command

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.tokenObject



6
7
8
# File 'lib/globus_client/authenticator.rb', line 6

def self.token
  new.token
end

Instance Method Details

#tokenObject

Request an access_token



11
12
13
14
15
16
17
# File 'lib/globus_client/authenticator.rb', line 11

def token
  response = connection.post('/v2/oauth2/token', form_data)

  UnexpectedResponse.call(response) unless response.success?

  JSON.parse(response.body)['access_token']
end