Class: Setsuzoku::Service::WebService::AuthStrategies::CustomAuthStrategy
- Inherits:
-
Setsuzoku::Service::WebService::AuthStrategy
- Object
- Setsuzoku::Service::WebService::AuthStrategy
- Setsuzoku::Service::WebService::AuthStrategies::CustomAuthStrategy
- Extended by:
- T::Helpers, T::Sig
- Includes:
- StrategyCanUseTokens
- Defined in:
- lib/setsuzoku/service/web_service/auth_strategies/custom_auth_strategy.rb
Overview
The API Custom Authentication Interface definition. Any Plugin that implements this must implement all methods required for Custom auth.
Defines all necessary methods for the custom auth strategy.
Instance Attribute Summary
Attributes included from AuthStrategy
Attributes included from HasConfigContext
Class Method Summary collapse
Instance Method Summary collapse
-
#auth_headers ⇒ Hash
Any custom auth headers required to perform authenticated requests.
-
#new_token! ⇒ void
Construct the custom token_request_body and request a token.
-
#refresh_expired_token! ⇒ void
Construct the custom token_request_body and request a token.
Methods included from StrategyCanUseTokens
Methods included from AuthStrategy
#auth_credential_valid?, #initialize, #new_credential!, #set_credential!
Methods included from HasConfigContext
Class Method Details
.credential_class ⇒ Object
22 23 24 |
# File 'lib/setsuzoku/service/web_service/auth_strategies/custom_auth_strategy.rb', line 22 def self.credential_class Setsuzoku::Service::WebService::Credentials::CustomAuthCredential end |
.required_instance_methods ⇒ Object
18 19 20 |
# File 'lib/setsuzoku/service/web_service/auth_strategies/custom_auth_strategy.rb', line 18 def self.required_instance_methods [] end |
Instance Method Details
#auth_headers ⇒ Hash
Any custom auth headers required to perform authenticated requests.
33 34 35 |
# File 'lib/setsuzoku/service/web_service/auth_strategies/custom_auth_strategy.rb', line 33 def auth_headers self.credential.auth_headers end |
#new_token! ⇒ void
This method returns an undefined value.
Construct the custom token_request_body and request a token.
44 45 46 47 48 |
# File 'lib/setsuzoku/service/web_service/auth_strategies/custom_auth_strategy.rb', line 44 def new_token! action = :new_token body = self.credential.auth_actions[action][:body] get_token!(body, action) end |
#refresh_expired_token! ⇒ void
This method returns an undefined value.
Construct the custom token_request_body and request a token.
57 58 59 60 61 |
# File 'lib/setsuzoku/service/web_service/auth_strategies/custom_auth_strategy.rb', line 57 def refresh_expired_token! action = :refresh_token body = self.credential.auth_actions[action][:body] get_token!(body, :refresh_token) end |