Module: PlentyClient::Authentication
- Extended by:
- 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 Endpoint
build_endpoint, routes
Methods included from Request
delete, get, patch, post, put, request
Class Method Details
.access_token(headers = {}, &block) ⇒ Object
13
14
15
|
# File 'lib/plenty_client/authentication.rb', line 13
def access_token( = {}, &block)
get(build_endpoint(AUTH_TOKEN), , &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 login(body = {})
post(build_endpoint(AUTH_LOGIN), body)
end
|
.login_refresh(body = {}) ⇒ Object
21
22
23
|
# File 'lib/plenty_client/authentication.rb', line 21
def login_refresh(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
|