Updated config
This commit is contained in:
@@ -0,0 +1,22 @@
|
|||||||
|
package net.gepafin.tendermanagement.config;
|
||||||
|
|
||||||
|
import org.opensaml.core.xml.io.MarshallingException;
|
||||||
|
import org.opensaml.core.xml.util.XMLObjectSupport;
|
||||||
|
import org.opensaml.saml.saml2.core.AuthnRequest;
|
||||||
|
import org.w3c.dom.Element;
|
||||||
|
|
||||||
|
import net.shibboleth.utilities.java.support.xml.SerializeSupport;
|
||||||
|
|
||||||
|
public class SamlRequestLogger {
|
||||||
|
|
||||||
|
public static String convertSAMLObjectToString(AuthnRequest authnRequest) {
|
||||||
|
try {
|
||||||
|
Element element = XMLObjectSupport.marshall(authnRequest);
|
||||||
|
return SerializeSupport.prettyPrintXML(element); // Pretty print XML using SerializeSupport
|
||||||
|
} catch (MarshallingException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return "Error converting SAML object to XML";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -266,8 +266,8 @@ public class SecurityConfig {
|
|||||||
context.getAuthnRequest().setRequestedAuthnContext(buildRequestedAuthnContext());
|
context.getAuthnRequest().setRequestedAuthnContext(buildRequestedAuthnContext());
|
||||||
|
|
||||||
// Log the SAML AuthnRequest after setting the authentication context
|
// Log the SAML AuthnRequest after setting the authentication context
|
||||||
String samlRequest = context.getAuthnRequest().toString(); // Get the updated AuthnRequest
|
String samlRequest = SamlRequestLogger.convertSAMLObjectToString(context.getAuthnRequest());
|
||||||
logger.info("SAML AuthnRequest after setting context: " + samlRequest); // Log the updated SAML request
|
logger.info("SAML AuthnRequest after setting context: " + samlRequest);
|
||||||
});
|
});
|
||||||
|
|
||||||
return authenticationRequestResolver;
|
return authenticationRequestResolver;
|
||||||
|
|||||||
Reference in New Issue
Block a user