Method: VMC::Client#login

Defined in:
lib/vmc/client.rb

#login(user, password) ⇒ Object

login and return an auth_token Auth token can be retained and used in creating new clients, avoiding login.



312
313
314
315
316
317
318
319
# File 'lib/vmc/client.rb', line 312

def (user, password)
  status, body, headers = json_post(path(VMC::USERS_PATH, user, "tokens"), {:password => password})
  response_info = json_parse(body)
  if response_info
    @user = user
    @auth_token = response_info[:token]
  end
end