Class: SoarAuthenticationToken::StaticTokenValidator
- Inherits:
-
Object
- Object
- SoarAuthenticationToken::StaticTokenValidator
- Defined in:
- lib/soar_authentication_token/providers/static_token_validator.rb
Instance Method Summary collapse
-
#initialize(configuration) ⇒ StaticTokenValidator
constructor
A new instance of StaticTokenValidator.
- #inject_store_provider(store_provider) ⇒ Object
- #validate(authentication_token:, request_information: nil, flow_identifier: nil) ⇒ Object
Constructor Details
#initialize(configuration) ⇒ StaticTokenValidator
Returns a new instance of StaticTokenValidator.
3 4 5 6 |
# File 'lib/soar_authentication_token/providers/static_token_validator.rb', line 3 def initialize(configuration) @configuration = configuration validate_configuration end |
Instance Method Details
#inject_store_provider(store_provider) ⇒ Object
8 9 10 |
# File 'lib/soar_authentication_token/providers/static_token_validator.rb', line 8 def inject_store_provider(store_provider) #ignore the store provider since this validator does not use a store end |
#validate(authentication_token:, request_information: nil, flow_identifier: nil) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/soar_authentication_token/providers/static_token_validator.rb', line 12 def validate(authentication_token:, request_information: nil, flow_identifier: nil) found_static_token = find_configured_static_token(authentication_token) return rejection_result(reason: 'Unknown static token') if found_static_token.nil? = (token_identifier: 'static_token', authenticated_identifier: found_static_token['authenticated_identifier'], token_issue_time: found_static_token['token_issue_time'], token_expiry_time: found_static_token['token_expiry_time']) return rejection_result(reason: "Expired token <#{['token_expiry_time']}> for <#{['authenticated_identifier']}>") if token_expired?() return success_result(token_meta: ) end |