class Athena::Security::Firewall::ExceptionListener
inherits Reference
#
Converts the security exceptions raised while handling the requests of a firewall into responses:
- An
ASEC::Exception::Authenticationstarts the authentication via the entry point of the firewall, e.g. by redirecting to the login page, or results in a401response if it has none - An
ASEC::Exception::AccessDeniedresults in a403response if the user is fully authenticated, otherwise it starts the authentication like anASEC::Exception::InsufficientAuthentication
Security exceptions are also handled if they caused the raised exception.
Constructors#
.new(token_storage : ASEC::Authentication::Token::Storage::Interface, authentication_trust_resolver : ASEC::Authentication::TrustResolverInterface, firewall_name : String, authentication_entry_point : ASEC::EntryPoint::Interface | Nil = nil)#
Creates a listener for the firewall with the provided firewall_name, starting the authentication via the provided authentication_entry_point, if any.
The authentication_trust_resolver determines whether the user of the token held by the provided token_storage is fully authenticated.
Methods#
#on_exception(event : AHK::Events::Exception) : Nil#
Handles the security exception of the provided event, if any.