Updated config
This commit is contained in:
@@ -74,13 +74,13 @@ public class SamlSuccessHandler implements AuthenticationSuccessHandler {
|
||||
String samlResponse = samlAuth.getSaml2Response();
|
||||
logger.info("Raw SAML Response: " + samlResponse);
|
||||
|
||||
// Parsing the SAML response as XML
|
||||
// If samlResponse is already in XML format, do not Base64 decode it
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
factory.setNamespaceAware(true);
|
||||
DocumentBuilder builder = factory.newDocumentBuilder();
|
||||
Document document = builder.parse(new ByteArrayInputStream(Base64.getDecoder().decode(samlResponse)));
|
||||
Document document = builder.parse(new ByteArrayInputStream(samlResponse.getBytes())); // Remove the Base64 decoding
|
||||
|
||||
// Extracting ID, InResponseTo, and IssueInstant from the Response element
|
||||
// Extracting ID, InResponseTo, and IssueInstant from the Response element
|
||||
Element responseElement = (Element) document.getElementsByTagNameNS("urn:oasis:names:tc:SAML:2.0:protocol", "Response").item(0);
|
||||
String responseId = responseElement.getAttribute("ID");
|
||||
String inResponseTo = responseElement.getAttribute("InResponseTo");
|
||||
|
||||
Reference in New Issue
Block a user