From c018757df831d7de6c910827fe20928bc5579321 Mon Sep 17 00:00:00 2001 From: rajesh Date: Mon, 23 Sep 2024 21:28:41 -0700 Subject: [PATCH] Updated config --- .../gepafin/tendermanagement/config/SecurityConfig.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/gepafin/tendermanagement/config/SecurityConfig.java b/src/main/java/net/gepafin/tendermanagement/config/SecurityConfig.java index 73213a77..409a4bb8 100644 --- a/src/main/java/net/gepafin/tendermanagement/config/SecurityConfig.java +++ b/src/main/java/net/gepafin/tendermanagement/config/SecurityConfig.java @@ -261,14 +261,19 @@ public class SecurityConfig { RelyingPartyRegistrationResolver registrationResolver = new DefaultRelyingPartyRegistrationResolver(registrations); OpenSaml4AuthenticationRequestResolver authenticationRequestResolver = new OpenSaml4AuthenticationRequestResolver(registrationResolver); - // Customize the AuthnRequest with the authentication context + // Customize and log the AuthnRequest after setting the context authenticationRequestResolver.setAuthnRequestCustomizer((context) -> { context.getAuthnRequest().setRequestedAuthnContext(buildRequestedAuthnContext()); + + // Log the SAML AuthnRequest after setting the authentication context + String samlRequest = context.getAuthnRequest().toString(); // Get the updated AuthnRequest + logger.info("SAML AuthnRequest after setting context: " + samlRequest); // Log the updated SAML request }); return authenticationRequestResolver; } + private RequestedAuthnContext buildRequestedAuthnContext() { AuthnContextClassRefBuilder authnContextClassRefBuilder = new AuthnContextClassRefBuilder(); AuthnContextClassRef authnContextClassRef = authnContextClassRefBuilder.buildObject(