Module: PlentyClient::Authentication

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

Constant Summary collapse

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

Class Method Summary collapse

Methods included from Request

included

Methods included from Endpoint

included

Class Method Details

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



15
16
17
# File 'lib/plenty_client/authentication.rb', line 15

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

.client_access_token(body = {}) ⇒ Object



31
32
33
# File 'lib/plenty_client/authentication.rb', line 31

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

.login(body = {}) ⇒ Object



19
20
21
# File 'lib/plenty_client/authentication.rb', line 19

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

.login_refresh(body = {}) ⇒ Object



23
24
25
# File 'lib/plenty_client/authentication.rb', line 23

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

.logout(body = {}) ⇒ Object



27
28
29
# File 'lib/plenty_client/authentication.rb', line 27

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