Updated config

This commit is contained in:
rajesh
2024-10-17 20:07:22 -07:00
parent 07498ce1ef
commit d57ff4d0f5

View File

@@ -74,11 +74,11 @@ 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
Element responseElement = (Element) document.getElementsByTagNameNS("urn:oasis:names:tc:SAML:2.0:protocol", "Response").item(0);