@Override public boolean authenticate() { authenticated = true; final Account account = performAuthentication(); if ( account == null ){ authenticated = false; getCurrentSession().setAuthenticatedAccount( account ); configuration.getAuthenticationFailureListener().onAuthenticationFailure( exchange, getCurrentSession(), currentAuthMechanism ); } else { getCurrentSession().setAuthenticatedAccount( account ); configuration.getAuthenticationSuccessListener().onAuthenticationSuccess(exchange, getCurrentSession(), currentAuthMechanism); notifySecurityEvent( LOGIN ); } updateCurrentSession(); return authenticated; }