String destinationQueryString = signRedirect(samlDocument, response.getRelayState(), keypair, response.getSendRequest()); response.setDestinationQueryStringWithSignature(destinationQueryString);
String destinationQueryString = signRedirect(samlDocument, response.getRelayState(), keypair, response.getSendRequest()); response.setDestinationQueryStringWithSignature(destinationQueryString);
private void sign(Document samlDocument, SAML2HandlerRequest request, SAML2HandlerResponse response) throws ProcessingException { if (!isSupportsSignature(request)) { return; } // Get the Key Pair KeyPair keypair = (KeyPair) this.handlerChainConfig.getParameter(GeneralConstants.KEYPAIR); X509Certificate x509Certificate = (X509Certificate) this.handlerChainConfig.getParameter(GeneralConstants.X509CERTIFICATE); if (keypair == null) { logger.samlHandlerKeyPairNotFound(); throw logger.samlHandlerKeyPairNotFoundError(); } if (response.isPostBindingForResponse()) { logger.trace("Going to sign response document with POST binding type"); signPost(samlDocument, keypair, x509Certificate); } else { logger.trace("Going to sign response document with REDIRECT binding type"); String destinationQueryString = signRedirect(samlDocument, response.getRelayState(), keypair, response.getSendRequest()); response.setDestinationQueryStringWithSignature(destinationQueryString); } }