Class: StickyIoRestfulApiV2025731::Basic
- Inherits:
-
CoreLibrary::HeaderAuth
- Object
- CoreLibrary::HeaderAuth
- StickyIoRestfulApiV2025731::Basic
- Includes:
- CoreLibrary
- Defined in:
- lib/sticky_io_restful_api_v2025731/http/auth/basic.rb
Overview
Utility class for basic authorization.
Instance Method Summary collapse
-
#error_message ⇒ Object
Display error message on occurrence of authentication failure.
-
#initialize(basic_credentials) ⇒ Basic
constructor
Initialization constructor.
Constructor Details
#initialize(basic_credentials) ⇒ Basic
Initialization constructor.
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/sticky_io_restful_api_v2025731/http/auth/basic.rb', line 17 def initialize(basic_credentials) auth_params = {} unless basic_credentials.nil? || basic_credentials.username.nil? || basic_credentials.password.nil? auth_params['Authorization'] = "Basic #{AuthHelper.get_base64_encoded_value(basic_credentials.username, basic_credentials.password)}" end super auth_params end |
Instance Method Details
#error_message ⇒ Object
Display error message on occurrence of authentication failure.
12 13 14 |
# File 'lib/sticky_io_restful_api_v2025731/http/auth/basic.rb', line 12 def 'Basic: username or password is undefined.' end |