Skip to content

Commit

Permalink
Upped SAML library
Browse files Browse the repository at this point in the history
  • Loading branch information
oharsta committed Nov 13, 2023
1 parent fe05363 commit f1e3d3b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion myconext-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<dependency>
<groupId>org.openconext</groupId>
<artifactId>saml-idp</artifactId>
<version>0.0.6-SNAPSHOT</version>
<version>0.0.7-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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());

Expand Down Expand Up @@ -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<Cookie> optionalCookie = cookieByName(request, BROWSER_SESSION_COOKIE_NAME);
optionalCookie.ifPresent(cookie -> {
Expand All @@ -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(),
Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit f1e3d3b

Please sign in to comment.