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, auditing = nil) ⇒ RackMiddleware
constructor
A new instance of RackMiddleware.
Constructor Details
#initialize(app, configuration, auditing = nil) ⇒ RackMiddleware
Returns a new instance of RackMiddleware.
5 6 7 8 9 |
# File 'lib/soar_authentication_token/rack_middleware.rb', line 5 def initialize(app, configuration, auditing = nil) @app = app @configuration = configuration @auditing = auditing end |
Instance Method Details
#call(env) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/soar_authentication_token/rack_middleware.rb', line 11 def call(env) session, params, token, flow_id = get_request_information(env) token_valid, , = validate_and_resolve_token(token,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 #{}",flow_id) rejection end |