Class: Yadecli::Client::AuthenticationClient

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/yadecli/client/authentication_client.rb

Overview

authentication client

Instance Method Summary collapse

Instance Method Details

#request_token(auth_url, username, password) ⇒ Object

request yade token



14
15
16
17
18
19
20
21
# File 'lib/yadecli/client/authentication_client.rb', line 14

def request_token(auth_url, username, password)

  options = { headers: { Accept: 'application/json', Authorization: 'Basic d2ViX2FwcDpjaGFuZ2VpdA==' } }

  self.class.base_uri auth_url

  self.class.post("/oauth/token?username=#{username}&password=#{password}&grant_type=password", options)
end