Class: MultiAuthSample::CustomAuth
- Inherits:
-
CoreLibrary::HeaderAuth
- Object
- CoreLibrary::HeaderAuth
- MultiAuthSample::CustomAuth
- Defined in:
- lib/multi_auth_sample/http/auth/custom_auth.rb
Overview
Utility class for custom authorization.
Instance Method Summary collapse
-
#error_message ⇒ Object
Display error message on occurrence of authentication failure.
-
#initialize(config) ⇒ CustomAuth
constructor
Initialization constructor.
-
#valid ⇒ Boolean
Validate arguments for authentication.
Constructor Details
#initialize(config) ⇒ CustomAuth
Initialization constructor.
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/multi_auth_sample/http/auth/custom_auth.rb', line 19 def initialize(config) auth_params = {} # TODO: Add your custom authentication here # The following properties are available to use # auth_params['accessToken'] = config.access_token super auth_params @_config = config end |
Instance Method Details
#error_message ⇒ Object
Display error message on occurrence of authentication failure.
11 12 13 14 15 16 |
# File 'lib/multi_auth_sample/http/auth/custom_auth.rb', line 11 def # TODO: Add your error message here in case of failure in authentication # # Example: # 'CustomAuth: config.access_token is undefined.' end |
#valid ⇒ Boolean
Validate arguments for authentication.
32 33 34 35 36 37 38 |
# File 'lib/multi_auth_sample/http/auth/custom_auth.rb', line 32 def valid # TODO: Add your validation checks here # # Example: # return false unless @_config.access_token.nil? true end |