Class: PFS::API::AuthenticationService

Inherits:
Service
  • Object
show all
Defined in:
lib/pfs/api/authentication_service.rb

Instance Attribute Summary

Attributes inherited from Service

#client

Instance Method Summary collapse

Methods inherited from Service

#initialize

Constructor Details

This class inherits a constructor from PFS::API::Service

Instance Method Details

#login(username, password, options = {}) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/pfs/api/authentication_service.rb', line 6

def (username, password, options = {})
  attributes = {
    username: username,
    password: password,
  }
  response = client.post("/Auth/Jwt", attributes, options)
  Resources::Authentication::Token.new(response, response.body[:data])
end