diff --git a/server/src/main/java/org/cloudfoundry/identity/uaa/authentication/UaaAuthentication.java b/server/src/main/java/org/cloudfoundry/identity/uaa/authentication/UaaAuthentication.java
index 10205f24ca0..e24f8157b03 100644
--- a/server/src/main/java/org/cloudfoundry/identity/uaa/authentication/UaaAuthentication.java
+++ b/server/src/main/java/org/cloudfoundry/identity/uaa/authentication/UaaAuthentication.java
@@ -109,16 +109,6 @@ public UaaAuthentication(UaaPrincipal uaaPrincipal,
this.userAttributes = new HashMap<>(userAttributes);
}
- public UaaAuthentication(UaaAuthentication existingAuthn, UaaPrincipal principal) {
-
- this(principal, existingAuthn.getCredentials(), List.copyOf(existingAuthn.getAuthorities()), existingAuthn.getExternalGroups(),
- existingAuthn.getUserAttributes(), existingAuthn.getUaaAuthenticationDetails(), existingAuthn.isAuthenticated(),
- existingAuthn.getAuthenticatedTime(), existingAuthn.getExpiresAt());
- this.authContextClassRef = existingAuthn.authContextClassRef;
- this.authenticationMethods = existingAuthn.authenticationMethods;
- this.lastLoginSuccessTime = existingAuthn.lastLoginSuccessTime;
- }
-
@Override
public String getName() {
// Should we return the ID for the principal name? (No, because the
diff --git a/server/src/main/java/org/cloudfoundry/identity/uaa/provider/saml/OpenSaml40CompatibleAssertionValidators.java b/server/src/main/java/org/cloudfoundry/identity/uaa/provider/saml/OpenSaml40CompatibleAssertionValidators.java
deleted file mode 100644
index b25c14568e3..00000000000
--- a/server/src/main/java/org/cloudfoundry/identity/uaa/provider/saml/OpenSaml40CompatibleAssertionValidators.java
+++ /dev/null
@@ -1,247 +0,0 @@
-package org.cloudfoundry.identity.uaa.provider.saml;
-
-import org.opensaml.core.config.ConfigurationService;
-import org.opensaml.core.xml.config.XMLObjectProviderRegistry;
-import org.opensaml.core.xml.config.XMLObjectProviderRegistrySupport;
-import org.opensaml.saml.common.assertion.ValidationContext;
-import org.opensaml.saml.common.assertion.ValidationResult;
-import org.opensaml.saml.saml2.assertion.ConditionValidator;
-import org.opensaml.saml.saml2.assertion.SAML20AssertionValidator;
-import org.opensaml.saml.saml2.assertion.SAML2AssertionValidationParameters;
-import org.opensaml.saml.saml2.assertion.StatementValidator;
-import org.opensaml.saml.saml2.assertion.SubjectConfirmationValidator;
-import org.opensaml.saml.saml2.assertion.impl.AudienceRestrictionConditionValidator;
-import org.opensaml.saml.saml2.assertion.impl.BearerSubjectConfirmationValidator;
-import org.opensaml.saml.saml2.assertion.impl.DelegationRestrictionConditionValidator;
-import org.opensaml.saml.saml2.core.Assertion;
-import org.opensaml.saml.saml2.core.AuthnRequest;
-import org.opensaml.saml.saml2.core.Condition;
-import org.opensaml.saml.saml2.core.OneTimeUse;
-import org.opensaml.saml.saml2.core.Response;
-import org.opensaml.saml.saml2.core.SubjectConfirmation;
-import org.opensaml.saml.saml2.core.SubjectConfirmationData;
-import org.opensaml.saml.saml2.core.impl.AuthnRequestUnmarshaller;
-import org.opensaml.saml.security.impl.SAMLSignatureProfileValidator;
-import org.opensaml.xmlsec.signature.support.SignaturePrevalidator;
-import org.opensaml.xmlsec.signature.support.SignatureTrustEngine;
-import org.springframework.core.convert.converter.Converter;
-import org.springframework.security.saml2.core.Saml2Error;
-import org.springframework.security.saml2.core.Saml2ErrorCodes;
-import org.springframework.security.saml2.core.Saml2ResponseValidatorResult;
-import org.springframework.security.saml2.provider.service.authentication.AbstractSaml2AuthenticationRequest;
-import org.springframework.security.saml2.provider.service.authentication.OpenSaml4AuthenticationProvider;
-import org.springframework.security.saml2.provider.service.authentication.Saml2AuthenticationException;
-import org.springframework.security.saml2.provider.service.authentication.Saml2AuthenticationToken;
-import org.springframework.security.saml2.provider.service.registration.RelyingPartyRegistration;
-import org.springframework.security.saml2.provider.service.registration.Saml2MessageBinding;
-import org.springframework.util.StringUtils;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-import javax.annotation.Nonnull;
-import javax.xml.namespace.QName;
-import java.io.ByteArrayInputStream;
-import java.nio.charset.StandardCharsets;
-import java.time.Duration;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.Consumer;
-
-/**
- * This class contains functions to Validate SAML assertions. It is based on the Spring-Security
- * class SAML20AssertionValidators within:
- * org.springframework.security.saml2.provider.service.authentication.OpenSaml4AuthenticationProvider
- *
- * But that class is not compatible with OpenSaml 4.0.x
- */
-public class OpenSaml40CompatibleAssertionValidators {
-
- private static final AuthnRequestUnmarshaller authnRequestUnmarshaller;
- private static final Collection conditions = new ArrayList<>();
- private static final Collection subjects = new ArrayList<>();
- private static final Collection statements = new ArrayList<>();
- private static final SignaturePrevalidator validator = new SAMLSignatureProfileValidator();
- private static final SAML20AssertionValidator attributeValidator = new SAML20AssertionValidator(conditions,
- subjects, statements, null, null) {
- @Nonnull
- @Override
- protected ValidationResult validateSignature(Assertion token, ValidationContext context) {
- return ValidationResult.VALID;
- }
- };
-
- static {
- XMLObjectProviderRegistry registry = ConfigurationService.get(XMLObjectProviderRegistry.class);
- authnRequestUnmarshaller = (AuthnRequestUnmarshaller) registry.getUnmarshallerFactory()
- .getUnmarshaller(AuthnRequest.DEFAULT_ELEMENT_NAME);
- }
-
- static {
- conditions.add(new AudienceRestrictionConditionValidator());
- conditions.add(new DelegationRestrictionConditionValidator());
- conditions.add(new ConditionValidator() {
- @Nonnull
- @Override
- public QName getServicedCondition() {
- return OneTimeUse.DEFAULT_ELEMENT_NAME;
- }
-
- @Nonnull
- @Override
- public ValidationResult validate(Condition condition, Assertion assertion, ValidationContext context) {
- // applications should validate their own OneTimeUse conditions
- return ValidationResult.VALID;
- }
- });
- subjects.add(new BearerSubjectConfirmationValidator() {
- @Override
- protected ValidationResult validateAddress(SubjectConfirmation confirmation, Assertion assertion,
- ValidationContext context, boolean required) {
- // applications should validate their own addresses - gh-7514
- return ValidationResult.VALID;
- }
- });
- }
-
- public static Converter createDefaultAssertionValidator() {
-
- return createDefaultAssertionValidatorWithParameters(
- (params) -> params.put(SAML2AssertionValidationParameters.CLOCK_SKEW, Duration.ofMinutes(5)));
- }
-
- public static Converter createDefaultAssertionValidatorWithParameters(
- Consumer