Class: AuthenticationService
- Inherits:
-
Object
- Object
- AuthenticationService
- Defined in:
- lib/services/authentication_service.rb
Overview
Authentication Service for token activies
Class Method Summary collapse
-
.create_authentication(auth_data) ⇒ Json
Creates authentication token.
-
.refresh_authentication_token(auth_data, bearer_token) ⇒ Json
Refresh authentication token.
-
.revoke_authentication_token(auth_data, bearer_token) ⇒ Json
Revokes authentication token.
Class Method Details
.create_authentication(auth_data) ⇒ Json
Creates authentication token
16 17 18 19 20 21 22 |
# File 'lib/services/authentication_service.rb', line 16 def self.create_authentication(auth_data) auth_payload = Authentication.get_payload_with_client_info(auth_data) RestClient::Request.execute(method: :post, url: ApplicationConfig.get_url('create_authentication_path'), payload: auth_payload, headers: { 'Content-Type': 'application/json' }) end |
.refresh_authentication_token(auth_data, bearer_token) ⇒ Json
Refresh authentication token
32 33 34 35 36 37 38 39 |
# File 'lib/services/authentication_service.rb', line 32 def self.refresh_authentication_token(auth_data, bearer_token) auth_payload = Authentication.get_payload_with_client_info(auth_data) RestClient::Request.execute(method: :post, url: ApplicationConfig.get_url('create_authentication_path'), payload: auth_payload, headers: { 'Content-Type': 'application/json', 'Authorization': bearer_token }) end |
.revoke_authentication_token(auth_data, bearer_token) ⇒ Json
Revokes authentication token
49 50 51 52 53 54 55 56 |
# File 'lib/services/authentication_service.rb', line 49 def self.revoke_authentication_token(auth_data, bearer_token) auth_payload = Authentication.get_payload(auth_data) RestClient::Request.execute(method: :post, url: ApplicationConfig.get_url('revoke_authentication_path'), payload: auth_payload, headers: { 'Content-Type': 'application/json', 'Authorization': bearer_token }) end |