Module: PlentyClient::Authentication

Includes:
Endpoint, Request
Defined in:
lib/plenty_client/authentication.rb

Constant Summary collapse

AUTH_LOGIN =
'/login'.freeze
AUTH_REFRESH =
'/login/refresh'.freeze
AUTH_TOKEN =
'/oauth/access_token'.freeze
AUTH_LOGOUT =
'/logout'.freeze
AUTH_CLIENT =
'/client-login'.freeze

Class Method Summary collapse

Methods included from Request

included

Methods included from Endpoint

included

Class Method Details

.access_token(headers = {}, &block) ⇒ Object



13
14
15
# File 'lib/plenty_client/authentication.rb', line 13

def access_token(headers = {}, &block)
  get(build_endpoint(AUTH_TOKEN), headers, &block)
end

.client_access_token(body = {}) ⇒ Object



29
30
31
# File 'lib/plenty_client/authentication.rb', line 29

def client_access_token(body = {})
  post(build_endpoint(AUTH_CLIENT), body)
end

.login(body = {}) ⇒ Object



17
18
19
# File 'lib/plenty_client/authentication.rb', line 17

def (body = {})
  post(build_endpoint(AUTH_LOGIN), body)
end

.login_refresh(body = {}) ⇒ Object



21
22
23
# File 'lib/plenty_client/authentication.rb', line 21

def (body = {})
  post(build_endpoint(AUTH_REFRESH), body)
end

.logout(body = {}) ⇒ Object



25
26
27
# File 'lib/plenty_client/authentication.rb', line 25

def logout(body = {})
  post(build_endpoint(AUTH_LOGOUT), body)
end