Class: SoarAuthenticationToken::RackMiddleware
- Inherits:
-
Object
- Object
- SoarAuthenticationToken::RackMiddleware
- Defined in:
- lib/soar_authentication_token/rack_middleware.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, configuration, service_identifier, auditing = nil) ⇒ RackMiddleware
constructor
A new instance of RackMiddleware.
Constructor Details
#initialize(app, configuration, service_identifier, auditing = nil) ⇒ RackMiddleware
6 7 8 9 10 11 |
# File 'lib/soar_authentication_token/rack_middleware.rb', line 6 def initialize(app, configuration, service_identifier, auditing = nil) @app = app @configuration = configuration @service_identifier = service_identifier @auditing = auditing end |
Instance Method Details
#call(env) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/soar_authentication_token/rack_middleware.rb', line 13 def call(env) session, params, token, flow_id, request_information, = get_request_information(env) token_valid, , = validate_and_resolve_token(token, request_information, flow_id) if token_valid session['user'] = ['authenticated_identifier'] session['auth_token_meta'] = return @app.call env end audit_token_rejection("Token rejected due to #{message}",flow_id) rejection end |