Class: KeycloakRack::Authenticate
- Inherits:
-
Object
- Object
- KeycloakRack::Authenticate
- Defined in:
- lib/keycloak_rack/authenticate.rb
Overview
The core service that handles authenticating a request from Keycloak.
Instance Method Summary collapse
Instance Method Details
#call(env) ⇒ Dry::Monads::Success(:authenticated, KeycloakRack::DecodedToken), ...
65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/keycloak_rack/authenticate.rb', line 65 def call(env) return Success[:skipped] if yield skip_authentication.call(env) token = yield read_token.call env return Success[:unauthenticated] if token.blank? payload, headers = yield decode_and_verify.call token decoded_token = yield wrap.call payload, headers Success[:authenticated, decoded_token] end |