dispatcher.forward(httpRequest, httpResponse);
return;
} catch (IOException ex) {
+ httpSession.removeAttribute(LoginContext.LOGIN_CONTEXT_KEY);
log.error("Error forwarding Shibboleth SSO request to AuthenticationManager", ex);
throw new ProfileException("Error forwarding Shibboleth SSO request to AuthenticationManager", ex);
} catch (ServletException ex) {
+ httpSession.removeAttribute(LoginContext.LOGIN_CONTEXT_KEY);
log.error("Error forwarding Shibboleth SSO request to AuthenticationManager", ex);
throw new ProfileException("Error forwarding Shibboleth SSO request to AuthenticationManager", ex);
- } finally {
- httpSession.removeAttribute(LoginContext.LOGIN_CONTEXT_KEY);
}
}
RequestDispatcher dispatcher = servletRequest.getRequestDispatcher(authenticationManagerPath);
dispatcher.forward(servletRequest, ((HttpServletResponseAdapter) outTransport).getWrappedResponse());
} catch (MarshallingException e) {
+ httpSession.removeAttribute(LoginContext.LOGIN_CONTEXT_KEY);
log.error("Unable to marshall authentication request context");
throw new ProfileException("Unable to marshall authentication request context", e);
} catch (IOException ex) {
+ httpSession.removeAttribute(LoginContext.LOGIN_CONTEXT_KEY);
log.error("Error forwarding SAML 2 AuthnRequest to AuthenticationManager", ex);
throw new ProfileException("Error forwarding SAML 2 AuthnRequest to AuthenticationManager", ex);
} catch (ServletException ex) {
+ httpSession.removeAttribute(LoginContext.LOGIN_CONTEXT_KEY);
log.error("Error forwarding SAML 2 AuthnRequest to AuthenticationManager", ex);
throw new ProfileException("Error forwarding SAML 2 AuthnRequest to AuthenticationManager", ex);
- } finally {
- httpSession.removeAttribute(LoginContext.LOGIN_CONTEXT_KEY);
}
}