Class: SoarAuthenticationToken::JwtTokenValidator
- Inherits:
-
Object
- Object
- SoarAuthenticationToken::JwtTokenValidator
- Defined in:
- lib/soar_authentication_token/providers/jwt_token_validator.rb
Instance Method Summary collapse
-
#initialize(configuration) ⇒ JwtTokenValidator
constructor
A new instance of JwtTokenValidator.
- #inject_store_provider(store_provider) ⇒ Object
- #validate(authentication_token:, flow_identifier:, request_information:) ⇒ Object
Constructor Details
#initialize(configuration) ⇒ JwtTokenValidator
Returns a new instance of JwtTokenValidator.
5 6 7 8 9 |
# File 'lib/soar_authentication_token/providers/jwt_token_validator.rb', line 5 def initialize(configuration) @configuration = configuration set_configuration_defaults validate_configuration end |
Instance Method Details
#inject_store_provider(store_provider) ⇒ Object
11 12 13 |
# File 'lib/soar_authentication_token/providers/jwt_token_validator.rb', line 11 def inject_store_provider(store_provider) @store_provider = store_provider end |
#validate(authentication_token:, flow_identifier:, request_information:) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/soar_authentication_token/providers/jwt_token_validator.rb', line 15 def validate(authentication_token:,flow_identifier:, request_information:) decoded_token_payload = decode(authentication_token) return rejection_result(reason: 'Token decode/verification failure') if decoded_token_payload.nil? = (decoded_token_payload) return rejection_result(reason: "Expired token <#{['token_expiry_time']}> for <#{['authenticated_identifier']}>") if token_expired?() return rejection_result(reason: "Unknown token for <#{['authenticated_identifier']}>") unless token_exist_in_store?(,flow_identifier) success_result(token_meta: ) end |