|
@@ -81,6 +81,12 @@ public final class RelyingPartyRegistration {
|
|
|
|
|
|
private final Saml2MessageBinding assertionConsumerServiceBinding;
|
|
|
|
|
|
+ private final String singleLogoutServiceLocation;
|
|
|
+
|
|
|
+ private final String singleLogoutServiceResponseLocation;
|
|
|
+
|
|
|
+ private final Saml2MessageBinding singleLogoutServiceBinding;
|
|
|
+
|
|
|
private final ProviderDetails providerDetails;
|
|
|
|
|
|
private final List<org.springframework.security.saml2.credentials.Saml2X509Credential> credentials;
|
|
@@ -90,7 +96,9 @@ public final class RelyingPartyRegistration {
|
|
|
private final Collection<Saml2X509Credential> signingX509Credentials;
|
|
|
|
|
|
private RelyingPartyRegistration(String registrationId, String entityId, String assertionConsumerServiceLocation,
|
|
|
- Saml2MessageBinding assertionConsumerServiceBinding, ProviderDetails providerDetails,
|
|
|
+ Saml2MessageBinding assertionConsumerServiceBinding, String singleLogoutServiceLocation,
|
|
|
+ String singleLogoutServiceResponseLocation, Saml2MessageBinding singleLogoutServiceBinding,
|
|
|
+ ProviderDetails providerDetails,
|
|
|
Collection<org.springframework.security.saml2.credentials.Saml2X509Credential> credentials,
|
|
|
Collection<Saml2X509Credential> decryptionX509Credentials,
|
|
|
Collection<Saml2X509Credential> signingX509Credentials) {
|
|
@@ -118,6 +126,9 @@ public final class RelyingPartyRegistration {
|
|
|
this.entityId = entityId;
|
|
|
this.assertionConsumerServiceLocation = assertionConsumerServiceLocation;
|
|
|
this.assertionConsumerServiceBinding = assertionConsumerServiceBinding;
|
|
|
+ this.singleLogoutServiceLocation = singleLogoutServiceLocation;
|
|
|
+ this.singleLogoutServiceResponseLocation = singleLogoutServiceResponseLocation;
|
|
|
+ this.singleLogoutServiceBinding = singleLogoutServiceBinding;
|
|
|
this.providerDetails = providerDetails;
|
|
|
this.credentials = Collections.unmodifiableList(new LinkedList<>(credentials));
|
|
|
this.decryptionX509Credentials = Collections.unmodifiableList(new LinkedList<>(decryptionX509Credentials));
|
|
@@ -177,6 +188,51 @@ public final class RelyingPartyRegistration {
|
|
|
return this.assertionConsumerServiceBinding;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Get the <a href=
|
|
|
+ * "https://wiki.shibboleth.net/confluence/display/CONCEPT/MetadataForIdP#MetadataForIdP-Logout">SingleLogoutService</a>
|
|
|
+ * Binding.
|
|
|
+ *
|
|
|
+ * <p>
|
|
|
+ * Equivalent to the value found in <SingleLogoutService Binding="..."/> in the
|
|
|
+ * relying party's <SPSSODescriptor>.
|
|
|
+ * @return the SingleLogoutService Binding
|
|
|
+ * @since 5.5
|
|
|
+ */
|
|
|
+ public Saml2MessageBinding getSingleLogoutServiceBinding() {
|
|
|
+ return this.singleLogoutServiceBinding;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get the <a href=
|
|
|
+ * "https://wiki.shibboleth.net/confluence/display/CONCEPT/MetadataForIdP#MetadataForIdP-Logout">SingleLogoutService</a>
|
|
|
+ * Location.
|
|
|
+ *
|
|
|
+ * <p>
|
|
|
+ * Equivalent to the value found in <SingleLogoutService Location="..."/> in the
|
|
|
+ * relying party's <SPSSODescriptor>.
|
|
|
+ * @return the SingleLogoutService Location
|
|
|
+ * @since 5.5
|
|
|
+ */
|
|
|
+ public String getSingleLogoutServiceLocation() {
|
|
|
+ return this.singleLogoutServiceLocation;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get the <a href=
|
|
|
+ * "https://wiki.shibboleth.net/confluence/display/CONCEPT/MetadataForIdP#MetadataForIdP-Logout">SingleLogoutService</a>
|
|
|
+ * Response Location.
|
|
|
+ *
|
|
|
+ * <p>
|
|
|
+ * Equivalent to the value found in <SingleLogoutService
|
|
|
+ * ResponseLocation="..."/> in the relying party's <SPSSODescriptor>.
|
|
|
+ * @return the SingleLogoutService Response Location
|
|
|
+ * @since 5.5
|
|
|
+ */
|
|
|
+ public String getSingleLogoutServiceResponseLocation() {
|
|
|
+ return this.singleLogoutServiceResponseLocation;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Get the {@link Collection} of decryption {@link Saml2X509Credential}s associated
|
|
|
* with this relying party
|
|
@@ -364,6 +420,9 @@ public final class RelyingPartyRegistration {
|
|
|
.decryptionX509Credentials((c) -> c.addAll(registration.getDecryptionX509Credentials()))
|
|
|
.assertionConsumerServiceLocation(registration.getAssertionConsumerServiceLocation())
|
|
|
.assertionConsumerServiceBinding(registration.getAssertionConsumerServiceBinding())
|
|
|
+ .singleLogoutServiceLocation(registration.getSingleLogoutServiceLocation())
|
|
|
+ .singleLogoutServiceResponseLocation(registration.getSingleLogoutServiceResponseLocation())
|
|
|
+ .singleLogoutServiceBinding(registration.getSingleLogoutServiceBinding())
|
|
|
.assertingPartyDetails((assertingParty) -> assertingParty
|
|
|
.entityId(registration.getAssertingPartyDetails().getEntityId())
|
|
|
.wantAuthnRequestsSigned(registration.getAssertingPartyDetails().getWantAuthnRequestsSigned())
|
|
@@ -376,7 +435,13 @@ public final class RelyingPartyRegistration {
|
|
|
.singleSignOnServiceLocation(
|
|
|
registration.getAssertingPartyDetails().getSingleSignOnServiceLocation())
|
|
|
.singleSignOnServiceBinding(
|
|
|
- registration.getAssertingPartyDetails().getSingleSignOnServiceBinding()));
|
|
|
+ registration.getAssertingPartyDetails().getSingleSignOnServiceBinding())
|
|
|
+ .singleLogoutServiceLocation(
|
|
|
+ registration.getAssertingPartyDetails().getSingleLogoutServiceLocation())
|
|
|
+ .singleLogoutServiceResponseLocation(
|
|
|
+ registration.getAssertingPartyDetails().getSingleLogoutServiceResponseLocation())
|
|
|
+ .singleLogoutServiceBinding(
|
|
|
+ registration.getAssertingPartyDetails().getSingleLogoutServiceBinding()));
|
|
|
}
|
|
|
|
|
|
private static Saml2X509Credential fromDeprecated(
|
|
@@ -445,10 +510,17 @@ public final class RelyingPartyRegistration {
|
|
|
|
|
|
private final Saml2MessageBinding singleSignOnServiceBinding;
|
|
|
|
|
|
+ private final String singleLogoutServiceLocation;
|
|
|
+
|
|
|
+ private final String singleLogoutServiceResponseLocation;
|
|
|
+
|
|
|
+ private final Saml2MessageBinding singleLogoutServiceBinding;
|
|
|
+
|
|
|
private AssertingPartyDetails(String entityId, boolean wantAuthnRequestsSigned, List<String> signingAlgorithms,
|
|
|
Collection<Saml2X509Credential> verificationX509Credentials,
|
|
|
Collection<Saml2X509Credential> encryptionX509Credentials, String singleSignOnServiceLocation,
|
|
|
- Saml2MessageBinding singleSignOnServiceBinding) {
|
|
|
+ Saml2MessageBinding singleSignOnServiceBinding, String singleLogoutServiceLocation,
|
|
|
+ String singleLogoutServiceResponseLocation, Saml2MessageBinding singleLogoutServiceBinding) {
|
|
|
Assert.hasText(entityId, "entityId cannot be null or empty");
|
|
|
Assert.notEmpty(signingAlgorithms, "signingAlgorithms cannot be empty");
|
|
|
Assert.notNull(verificationX509Credentials, "verificationX509Credentials cannot be null");
|
|
@@ -472,6 +544,9 @@ public final class RelyingPartyRegistration {
|
|
|
this.encryptionX509Credentials = encryptionX509Credentials;
|
|
|
this.singleSignOnServiceLocation = singleSignOnServiceLocation;
|
|
|
this.singleSignOnServiceBinding = singleSignOnServiceBinding;
|
|
|
+ this.singleLogoutServiceLocation = singleLogoutServiceLocation;
|
|
|
+ this.singleLogoutServiceResponseLocation = singleLogoutServiceResponseLocation;
|
|
|
+ this.singleLogoutServiceBinding = singleLogoutServiceBinding;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -565,6 +640,48 @@ public final class RelyingPartyRegistration {
|
|
|
return this.singleSignOnServiceBinding;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Get the <a href=
|
|
|
+ * "https://wiki.shibboleth.net/confluence/display/CONCEPT/MetadataForIdP#MetadataForIdP-Logout">SingleLogoutService</a>
|
|
|
+ * Location.
|
|
|
+ *
|
|
|
+ * <p>
|
|
|
+ * Equivalent to the value found in <SingleLogoutService Location="..."/> in
|
|
|
+ * the asserting party's <IDPSSODescriptor>.
|
|
|
+ * @return the SingleLogoutService Location
|
|
|
+ */
|
|
|
+ public String getSingleLogoutServiceLocation() {
|
|
|
+ return this.singleLogoutServiceLocation;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get the <a href=
|
|
|
+ * "https://wiki.shibboleth.net/confluence/display/CONCEPT/MetadataForIdP#MetadataForIdP-Logout">SingleLogoutService</a>
|
|
|
+ * ResponseLocation.
|
|
|
+ *
|
|
|
+ * <p>
|
|
|
+ * Equivalent to the value found in <SingleLogoutService Location="..."/> in
|
|
|
+ * the asserting party's <IDPSSODescriptor>.
|
|
|
+ * @return the SingleLogoutService Response Location
|
|
|
+ */
|
|
|
+ public String getSingleLogoutServiceResponseLocation() {
|
|
|
+ return this.singleLogoutServiceResponseLocation;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get the <a href=
|
|
|
+ * "https://wiki.shibboleth.net/confluence/display/CONCEPT/MetadataForIdP#MetadataForIdP-Logout">SingleLogoutService</a>
|
|
|
+ * Binding.
|
|
|
+ *
|
|
|
+ * <p>
|
|
|
+ * Equivalent to the value found in <SingleLogoutService Binding="..."/> in
|
|
|
+ * the asserting party's <IDPSSODescriptor>.
|
|
|
+ * @return the SingleLogoutService Binding
|
|
|
+ */
|
|
|
+ public Saml2MessageBinding getSingleLogoutServiceBinding() {
|
|
|
+ return this.singleLogoutServiceBinding;
|
|
|
+ }
|
|
|
+
|
|
|
public static final class Builder {
|
|
|
|
|
|
private String entityId;
|
|
@@ -581,6 +698,12 @@ public final class RelyingPartyRegistration {
|
|
|
|
|
|
private Saml2MessageBinding singleSignOnServiceBinding = Saml2MessageBinding.REDIRECT;
|
|
|
|
|
|
+ private String singleLogoutServiceLocation;
|
|
|
+
|
|
|
+ private String singleLogoutServiceResponseLocation;
|
|
|
+
|
|
|
+ private Saml2MessageBinding singleLogoutServiceBinding = Saml2MessageBinding.REDIRECT;
|
|
|
+
|
|
|
/**
|
|
|
* Set the asserting party's <a href=
|
|
|
* "https://wiki.shibboleth.net/confluence/display/CONCEPT/EntityNaming">EntityID</a>.
|
|
@@ -677,6 +800,55 @@ public final class RelyingPartyRegistration {
|
|
|
return this;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Set the <a href=
|
|
|
+ * "https://wiki.shibboleth.net/confluence/display/CONCEPT/MetadataForIdP#MetadataForIdP-Logout">SingleLogoutService</a>
|
|
|
+ * Location.
|
|
|
+ *
|
|
|
+ * <p>
|
|
|
+ * Equivalent to the value found in <SingleLogoutService
|
|
|
+ * Location="..."/> in the asserting party's <IDPSSODescriptor>.
|
|
|
+ * @return the SingleLogoutService Location
|
|
|
+ * @since 5.5
|
|
|
+ */
|
|
|
+ public Builder singleLogoutServiceLocation(String singleLogoutServiceLocation) {
|
|
|
+ this.singleLogoutServiceLocation = singleLogoutServiceLocation;
|
|
|
+ return this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set the <a href=
|
|
|
+ * "https://wiki.shibboleth.net/confluence/display/CONCEPT/MetadataForIdP#MetadataForIdP-Logout">SingleLogoutService</a>
|
|
|
+ * Response Location.
|
|
|
+ *
|
|
|
+ * <p>
|
|
|
+ * Equivalent to the value found in <SingleLogoutService
|
|
|
+ * ResponseLocation="..."/> in the asserting party's
|
|
|
+ * <IDPSSODescriptor>.
|
|
|
+ * @return the SingleLogoutService Response Location
|
|
|
+ * @since 5.5
|
|
|
+ */
|
|
|
+ public Builder singleLogoutServiceResponseLocation(String singleLogoutServiceResponseLocation) {
|
|
|
+ this.singleLogoutServiceResponseLocation = singleLogoutServiceResponseLocation;
|
|
|
+ return this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set the <a href=
|
|
|
+ * "https://wiki.shibboleth.net/confluence/display/CONCEPT/MetadataForIdP#MetadataForIdP-Logout">SingleLogoutService</a>
|
|
|
+ * Binding.
|
|
|
+ *
|
|
|
+ * <p>
|
|
|
+ * Equivalent to the value found in <SingleLogoutService Binding="..."/>
|
|
|
+ * in the asserting party's <IDPSSODescriptor>.
|
|
|
+ * @return the SingleLogoutService Binding
|
|
|
+ * @since 5.5
|
|
|
+ */
|
|
|
+ public Builder singleLogoutServiceBinding(Saml2MessageBinding singleLogoutServiceBinding) {
|
|
|
+ this.singleLogoutServiceBinding = singleLogoutServiceBinding;
|
|
|
+ return this;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Creates an immutable ProviderDetails object representing the configuration
|
|
|
* for an Identity Provider, IDP
|
|
@@ -689,7 +861,9 @@ public final class RelyingPartyRegistration {
|
|
|
|
|
|
return new AssertingPartyDetails(this.entityId, this.wantAuthnRequestsSigned, signingAlgorithms,
|
|
|
this.verificationX509Credentials, this.encryptionX509Credentials,
|
|
|
- this.singleSignOnServiceLocation, this.singleSignOnServiceBinding);
|
|
|
+ this.singleSignOnServiceLocation, this.singleSignOnServiceBinding,
|
|
|
+ this.singleLogoutServiceLocation, this.singleLogoutServiceResponseLocation,
|
|
|
+ this.singleLogoutServiceBinding);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -830,6 +1004,12 @@ public final class RelyingPartyRegistration {
|
|
|
|
|
|
private Saml2MessageBinding assertionConsumerServiceBinding = Saml2MessageBinding.POST;
|
|
|
|
|
|
+ private String singleLogoutServiceLocation;
|
|
|
+
|
|
|
+ private String singleLogoutServiceResponseLocation;
|
|
|
+
|
|
|
+ private Saml2MessageBinding singleLogoutServiceBinding = Saml2MessageBinding.POST;
|
|
|
+
|
|
|
private ProviderDetails.Builder providerDetails = new ProviderDetails.Builder();
|
|
|
|
|
|
private Collection<org.springframework.security.saml2.credentials.Saml2X509Credential> credentials = new HashSet<>();
|
|
@@ -933,6 +1113,54 @@ public final class RelyingPartyRegistration {
|
|
|
return this;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Set the <a href=
|
|
|
+ * "https://wiki.shibboleth.net/confluence/display/CONCEPT/MetadataForIdP#MetadataForIdP-Logout">SingleLogoutService</a>
|
|
|
+ * Binding.
|
|
|
+ *
|
|
|
+ * <p>
|
|
|
+ * Equivalent to the value found in <SingleLogoutService Binding="..."/> in
|
|
|
+ * the relying party's <SPSSODescriptor>.
|
|
|
+ * @return the SingleLogoutService Binding
|
|
|
+ * @since 5.5
|
|
|
+ */
|
|
|
+ public Builder singleLogoutServiceBinding(Saml2MessageBinding singleLogoutServiceBinding) {
|
|
|
+ this.singleLogoutServiceBinding = singleLogoutServiceBinding;
|
|
|
+ return this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set the <a href=
|
|
|
+ * "https://wiki.shibboleth.net/confluence/display/CONCEPT/MetadataForIdP#MetadataForIdP-Logout">SingleLogoutService</a>
|
|
|
+ * Location.
|
|
|
+ *
|
|
|
+ * <p>
|
|
|
+ * Equivalent to the value found in <SingleLogoutService Location="..."/> in
|
|
|
+ * the relying party's <SPSSODescriptor>.
|
|
|
+ * @return the SingleLogoutService Location
|
|
|
+ * @since 5.5
|
|
|
+ */
|
|
|
+ public Builder singleLogoutServiceLocation(String singleLogoutServiceLocation) {
|
|
|
+ this.singleLogoutServiceLocation = singleLogoutServiceLocation;
|
|
|
+ return this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set the <a href=
|
|
|
+ * "https://wiki.shibboleth.net/confluence/display/CONCEPT/MetadataForIdP#MetadataForIdP-Logout">SingleLogoutService</a>
|
|
|
+ * Response Location.
|
|
|
+ *
|
|
|
+ * <p>
|
|
|
+ * Equivalent to the value found in <SingleLogoutService
|
|
|
+ * ResponseLocation="..."/> in the relying party's <SPSSODescriptor>.
|
|
|
+ * @return the SingleLogoutService Response Location
|
|
|
+ * @since 5.5
|
|
|
+ */
|
|
|
+ public Builder singleLogoutServiceResponseLocation(String singleLogoutServiceResponseLocation) {
|
|
|
+ this.singleLogoutServiceResponseLocation = singleLogoutServiceResponseLocation;
|
|
|
+ return this;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Apply this {@link Consumer} to further configure the Asserting Party details
|
|
|
* @param assertingPartyDetails The {@link Consumer} to apply
|
|
@@ -1075,10 +1303,14 @@ public final class RelyingPartyRegistration {
|
|
|
for (Saml2X509Credential credential : this.providerDetails.assertingPartyDetailsBuilder.encryptionX509Credentials) {
|
|
|
this.credentials.add(toDeprecated(credential));
|
|
|
}
|
|
|
+ if (this.singleLogoutServiceResponseLocation == null) {
|
|
|
+ this.singleLogoutServiceResponseLocation = this.singleLogoutServiceLocation;
|
|
|
+ }
|
|
|
return new RelyingPartyRegistration(this.registrationId, this.entityId,
|
|
|
this.assertionConsumerServiceLocation, this.assertionConsumerServiceBinding,
|
|
|
- this.providerDetails.build(), this.credentials, this.decryptionX509Credentials,
|
|
|
- this.signingX509Credentials);
|
|
|
+ this.singleLogoutServiceLocation, this.singleLogoutServiceResponseLocation,
|
|
|
+ this.singleLogoutServiceBinding, this.providerDetails.build(), this.credentials,
|
|
|
+ this.decryptionX509Credentials, this.signingX509Credentials);
|
|
|
}
|
|
|
|
|
|
}
|