From f1e3d3ba42b92326dcfa44ab117134805205a0de Mon Sep 17 00:00:00 2001 From: Okke Harsta Date: Mon, 13 Nov 2023 13:19:00 +0100 Subject: [PATCH] Upped SAML library --- myconext-server/pom.xml | 2 +- .../GuestIdpAuthenticationRequestFilter.java | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/myconext-server/pom.xml b/myconext-server/pom.xml index 075e4227..41ef679e 100644 --- a/myconext-server/pom.xml +++ b/myconext-server/pom.xml @@ -40,7 +40,7 @@ org.openconext saml-idp - 0.0.6-SNAPSHOT + 0.0.7-SNAPSHOT org.springframework.boot diff --git a/myconext-server/src/main/java/myconext/security/GuestIdpAuthenticationRequestFilter.java b/myconext-server/src/main/java/myconext/security/GuestIdpAuthenticationRequestFilter.java index 28f627f7..acb89ec4 100644 --- a/myconext-server/src/main/java/myconext/security/GuestIdpAuthenticationRequestFilter.java +++ b/myconext-server/src/main/java/myconext/security/GuestIdpAuthenticationRequestFilter.java @@ -24,7 +24,7 @@ import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; import org.springframework.web.filter.OncePerRequestFilter; -import saml.DefaultSAMLIdPService; +import saml.DefaultSAMLService; import saml.model.SAMLAttribute; import saml.model.SAMLConfiguration; import saml.model.SAMLStatus; @@ -92,7 +92,7 @@ public class GuestIdpAuthenticationRequestFilter extends OncePerRequestFilter im private final long ssoMFADurationSeconds; private final String mobileAppROEntityId; private final boolean featureDefaultRememberMe; - private final DefaultSAMLIdPService samlIdpService; + private final DefaultSAMLService samlService; public GuestIdpAuthenticationRequestFilter(String redirectUrl, ServiceProviderResolver serviceProviderResolver, @@ -133,7 +133,7 @@ public GuestIdpAuthenticationRequestFilter(String redirectUrl, this.ssoMFADurationSeconds = ssoMFADurationSeconds; this.mobileAppROEntityId = mobileAppROEntityId; this.featureDefaultRememberMe = featureDefaultRememberMe; - this.samlIdpService = new DefaultSAMLIdPService(configuration); + this.samlService = new DefaultSAMLService(configuration); this.executor = Executors.newSingleThreadExecutor(); this.identityProviderMetaData = identityProviderMetaData; } @@ -168,7 +168,7 @@ private void sso(HttpServletRequest request, HttpServletResponse response) throw //prevent null-pointer and drop dead return; } - AuthnRequest authnRequest = this.samlIdpService.parseAuthnRequest(samlRequest, true, isDeflated(request)); + AuthnRequest authnRequest = this.samlService.parseAuthnRequest(samlRequest, true, isDeflated(request)); String requesterEntityId = requesterId(authnRequest); String issuer = authnRequest.getIssuer().getValue(); @@ -640,7 +640,7 @@ private void sendAssertion(HttpServletRequest request, boolean applySsoMfa = this.isApplySsoMfa(); SAMLStatus samlStatus = SAMLStatus.SUCCESS; String optionalMessage = null; - String authnContextClassRefValue = DefaultSAMLIdPService.authnContextClassRefPassword; + String authnContextClassRefValue = DefaultSAMLService.authnContextClassRefPassword; if (samlAuthenticationRequest.isAccountLinkingRequired()) { boolean hasStudentAffiliation = hasRequiredStudentAffiliation(user.allEduPersonAffiliations()); @@ -674,7 +674,7 @@ private void sendAssertion(HttpServletRequest request, samlStatus = SAMLStatus.NO_AUTHN_CONTEXT; } if (!samlStatus.equals(SAMLStatus.SUCCESS)) { - authnContextClassRefValue = DefaultSAMLIdPService.authnContextClassRefUnspecified; + authnContextClassRefValue = DefaultSAMLService.authnContextClassRefUnspecified; } Optional optionalCookie = cookieByName(request, BROWSER_SESSION_COOKIE_NAME); optionalCookie.ifPresent(cookie -> { @@ -683,7 +683,7 @@ private void sendAssertion(HttpServletRequest request, }); //Tracking cookie for user new device discovery this.addTrackingCookie(request, response, user); - this.samlIdpService.sendResponse( + this.samlService.sendResponse( samlAuthenticationRequest.getIssuer(), samlAuthenticationRequest.getRequestId(), user.getUid(), @@ -776,7 +776,7 @@ private void metaData(HttpServletResponse servletResponse) throws IOException { servletResponse.setCharacterEncoding(UTF_8.name()); servletResponse.setHeader("Cache-Control", "private"); - String metaData = this.samlIdpService.metaData( + String metaData = this.samlService.metaData( this.identityProviderMetaData.getSingleSignOnServiceURI(), this.identityProviderMetaData.getName(), this.identityProviderMetaData.getDescription(),