protected void processSAMLRequestMessage(Request request, Response response) throws IOException {
Principal userPrincipal = request.getPrincipal();
Session session = request.getSessionInternal();
SAMLDocumentHolder samlDocumentHolder = null;
SAML2Object samlObject = null;
Document samlResponse = null;
boolean isErrorResponse = false;
String destination = null;
String destinationQueryStringWithSignature = null;
Boolean requestedPostProfile = null;
String samlRequestMessage = (String) session.getNote(GeneralConstants.SAML_REQUEST_KEY);
String relayState = (String) session.getNote(GeneralConstants.RELAY_STATE);
String contextPath = getContextPath();
boolean willSendRequest = false;
String referer = request.getHeader("Referer");
cleanUpSessionNote(request);
// Determine the transport mechanism
boolean isSecure = request.isSecure();
String loginType = determineLoginType(isSecure);
IDPWebRequestUtil webRequestUtil = new IDPWebRequestUtil(request, idpConfiguration, keyManager);
try {
samlDocumentHolder = webRequestUtil.getSAMLDocumentHolder(samlRequestMessage);
samlObject = samlDocumentHolder.getSamlObject();
if (!(samlObject instanceof RequestAbstractType)) {
throw logger.wrongTypeError(samlObject.getClass().getName());
}
// Get the SAML Request Message
RequestAbstractType requestAbstractType = (RequestAbstractType) samlObject;
String issuer = requestAbstractType.getIssuer().getValue();