Replace deprecated OpenSaml methods

This commit is contained in:
Brummolix 2023-03-30 09:53:38 +02:00 committed by Josh Cummings
parent 6f8ec3df60
commit d4ed0ad0cf
4 changed files with 4 additions and 4 deletions

View File

@ -186,7 +186,7 @@ public final class OpenSamlMetadataResolver implements Saml2MetadataResolver {
private NameIDFormat buildNameIDFormat(RelyingPartyRegistration registration) {
NameIDFormat nameIdFormat = build(NameIDFormat.DEFAULT_ELEMENT_NAME);
nameIdFormat.setFormat(registration.getNameIdFormat());
nameIdFormat.setURI(registration.getNameIdFormat());
return nameIdFormat;
}

View File

@ -143,7 +143,7 @@ final class OpenSamlLogoutRequestResolver {
Saml2AuthenticatedPrincipal principal = (Saml2AuthenticatedPrincipal) authentication.getPrincipal();
for (String index : principal.getSessionIndexes()) {
SessionIndex sessionIndex = this.sessionIndexBuilder.buildObject();
sessionIndex.setSessionIndex(index);
sessionIndex.setValue(index);
logoutRequest.getSessionIndexes().add(sessionIndex);
}
}

View File

@ -364,7 +364,7 @@ public final class TestOpenSamlObjects {
Attribute websiteAttr = attributeBuilder.buildObject();
websiteAttr.setName("website");
XSURI uri = new XSURIBuilder().buildObject(AttributeValue.DEFAULT_ELEMENT_NAME, XSURI.TYPE_NAME);
uri.setValue("https://johndoe.com/");
uri.setURI("https://johndoe.com/");
websiteAttr.getAttributeValues().add(uri);
attrStmt2.getAttributes().add(websiteAttr);
Attribute registeredAttr = attributeBuilder.buildObject();

View File

@ -87,7 +87,7 @@ public class OpenSamlLogoutRequestResolverTests {
LogoutRequest logoutRequest = getLogoutRequest(saml2LogoutRequest.getSamlRequest(), binding);
assertThat(logoutRequest.getNameID().getValue()).isEqualTo(authentication.getName());
assertThat(logoutRequest.getSessionIndexes()).hasSize(1);
assertThat(logoutRequest.getSessionIndexes().get(0).getSessionIndex()).isEqualTo("session-index");
assertThat(logoutRequest.getSessionIndexes().get(0).getValue()).isEqualTo("session-index");
}
private Saml2Authentication authentication(RelyingPartyRegistration registration) {