}
}
if(principal != null){
logger.debug("Login successful, firing the AuthenticatedEvent event");
authenticatedEvent.fire(new AuthenticatedEvent(principal));
}else{
logger.debug("Login failed, firing the AuthenticateFailedEvent event");
authenticationFailedEvent.fire(event);
}