Skip to content

Commit aceacfe

Browse files
RAMPART-454 Upgrade OpenSAML from 4.3.2 to 5.2.1
OpenSAML 5.x API changes: - opensaml-core artifact renamed to opensaml-core-api (all other artifacts unchanged) - AuthnContextClassRef.setAuthnContextClassRef() -> setURI() - ConfirmationMethod.getConfirmationMethod() -> getURI() - ConfirmationMethod.setConfirmationMethod() -> setURI() Only 4 method renames needed. The Shibboleth Maven repo URL was updated in the previous commit. Builds successfully with: mvn install -Dmaven.test.skip=true -Dmaven.javadoc.skip=true Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 34f6918 commit aceacfe

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

modules/rampart-trust/src/main/java/org/apache/rahas/impl/SAML2TokenIssuer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -699,9 +699,9 @@ protected AuthnStatement createAuthenticationStatement(RahasData data) throws Tr
699699

700700
//if username/password based authn
701701
if (inMsgCtx.getProperty(RahasConstants.USERNAME) != null) {
702-
authCtxClassRef.setAuthnContextClassRef(AuthnContext.PASSWORD_AUTHN_CTX);
702+
authCtxClassRef.setURI(AuthnContext.PASSWORD_AUTHN_CTX);
703703
} else if (inMsgCtx.getProperty(RahasConstants.X509_CERT) != null) { //if X.509 cert based authn
704-
authCtxClassRef.setAuthnContextClassRef(AuthnContext.X509_AUTHN_CTX);
704+
authCtxClassRef.setURI(AuthnContext.X509_AUTHN_CTX);
705705
}
706706

707707
authContext.setAuthnContextClassRef(authCtxClassRef);

modules/rampart-trust/src/main/java/org/apache/rahas/impl/util/SAMLUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ public static String getSAML11SubjectConfirmationMethod(Assertion assertion) {
188188
List<ConfirmationMethod> confirmationMethods = subjectConfirmation.getConfirmationMethods();
189189

190190
if (!confirmationMethods.isEmpty()) {
191-
subjectConfirmationMethod = confirmationMethods.get(0).getConfirmationMethod();
191+
subjectConfirmationMethod = confirmationMethods.get(0).getURI();
192192
}
193193
}
194194
}
@@ -232,7 +232,7 @@ public static ConfirmationMethod createSubjectConfirmationMethod(final String co
232232

233233
ConfirmationMethod confirmationMethodObject
234234
= (ConfirmationMethod)CommonUtil.buildXMLObject(ConfirmationMethod.DEFAULT_ELEMENT_NAME);
235-
confirmationMethodObject.setConfirmationMethod(confirmationMethod);
235+
confirmationMethodObject.setURI(confirmationMethod);
236236

237237
return confirmationMethodObject;
238238
}

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@
568568
</dependency>
569569
<dependency>
570570
<groupId>org.opensaml</groupId>
571-
<artifactId>opensaml-core</artifactId>
571+
<artifactId>opensaml-core-api</artifactId>
572572
<version>${opensaml.version}</version>
573573
<scope>compile</scope>
574574
</dependency>
@@ -849,7 +849,7 @@
849849
<axiom.version>2.0.0</axiom.version>
850850

851851
<wss4j.version>3.0.3</wss4j.version>
852-
<opensaml.version>4.3.2</opensaml.version>
852+
<opensaml.version>5.2.1</opensaml.version>
853853
<shibboleth.utilities.version>8.4.2</shibboleth.utilities.version>
854854
<dropwizard.metrics.version>4.2.19</dropwizard.metrics.version>
855855
<cryptacular.version>1.2.4</cryptacular.version>

0 commit comments

Comments
 (0)