public String buildHtmlPostResponse(Document responseDoc, String actionUrl, boolean asRequest) throws ProcessingException, ConfigurationException, IOException { byte[] responseBytes = org.keycloak.saml.common.util.DocumentUtil.getDocumentAsString(responseDoc) .getBytes("UTF-8"); String samlResponse = PostBindingUtil.base64Encode(new String(responseBytes)); return buildHtml(samlResponse, actionUrl, asRequest); }