class AuthenticationService

Authentication Service for token activies

Public Class Methods

create_authentication(auth_data) click to toggle source

Creates authentication token

@param [object] auth_data Authentication object

@return [Json] Response with brearer and refresh token

# 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) click to toggle source

Refresh authentication token

@param [Object] auth_data Authentication object @param [String] bearer_token

@return [Json] Response with brearer and refresh token

# 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) click to toggle source

Revokes authentication token

@param [Object] auth_data Authentication object @param [String] bearer_token

@return [Json] Response with revoke message

# 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