public final class RelyingPartyRegistration
extends java.lang.Object
Each RP/AP pair is uniquely identified using a registrationId
, an arbitrary
string.
A fully configured registration may look like:
String registrationId = "simplesamlphp"; String relyingPartyEntityId = "{baseUrl}/saml2/service-provider-metadata/{registrationId}"; String assertionConsumerServiceLocation = "{baseUrl}/login/saml2/sso/{registrationId}"; Saml2X509Credential relyingPartySigningCredential = ...; String assertingPartyEntityId = "https://simplesaml-for-spring-saml.apps.pcfone.io/saml2/idp/metadata.php"; String singleSignOnServiceLocation = "https://simplesaml-for-spring-saml.apps.pcfone.io/saml2/idp/SSOService.php"; Saml2X509Credential assertingPartyVerificationCredential = ...; RelyingPartyRegistration rp = RelyingPartyRegistration.withRegistrationId(registrationId) .entityId(relyingPartyEntityId) .assertionConsumerServiceLocation(assertingConsumerServiceLocation) .signingX509Credentials((c) -> c.add(relyingPartySigningCredential)) .assertingPartyDetails((details) -> details .entityId(assertingPartyEntityId)); .singleSignOnServiceLocation(singleSignOnServiceLocation)) .verifyingX509Credentials((c) -> c.add(assertingPartyVerificationCredential)) .build();
Modifier and Type | Class and Description |
---|---|
static class |
RelyingPartyRegistration.AssertingPartyDetails
The configuration metadata of the Asserting party
|
static class |
RelyingPartyRegistration.Builder |
static class |
RelyingPartyRegistration.ProviderDetails
Deprecated.
Use
RelyingPartyRegistration.AssertingPartyDetails instead |
Modifier and Type | Method and Description |
---|---|
RelyingPartyRegistration.AssertingPartyDetails |
getAssertingPartyDetails()
Get the configuration details for the Asserting Party
|
Saml2MessageBinding |
getAssertionConsumerServiceBinding()
Get the AssertionConsumerService Binding.
|
java.lang.String |
getAssertionConsumerServiceLocation()
Get the AssertionConsumerService Location.
|
java.lang.String |
getAssertionConsumerServiceUrlTemplate()
Deprecated.
Use
getAssertionConsumerServiceLocation() instead |
java.util.List<Saml2X509Credential> |
getCredentials()
Deprecated.
Instead of retrieving all credentials, use the appropriate method for
obtaining the correct type
|
java.util.List<Saml2X509Credential> |
getDecryptionCredentials()
Deprecated.
Use
getDecryptionX509Credentials() instead |
java.util.Collection<Saml2X509Credential> |
getDecryptionX509Credentials()
Get the
Collection of decryption Saml2X509Credential s associated
with this relying party |
java.util.List<Saml2X509Credential> |
getEncryptionCredentials()
Deprecated.
|
java.lang.String |
getEntityId()
Get the relying party's EntityID.
|
java.lang.String |
getIdpWebSsoUrl()
|
java.lang.String |
getLocalEntityIdTemplate()
Deprecated.
Use
getEntityId() instead |
RelyingPartyRegistration.ProviderDetails |
getProviderDetails()
Deprecated.
Use
getAssertingPartyDetails() instead |
java.lang.String |
getRegistrationId()
Get the unique registration id for this RP/AP pair
|
java.lang.String |
getRemoteIdpEntityId()
Deprecated.
|
java.util.List<Saml2X509Credential> |
getSigningCredentials()
Deprecated.
Use
getSigningX509Credentials() instead |
java.util.Collection<Saml2X509Credential> |
getSigningX509Credentials()
Get the
Collection of signing Saml2X509Credential s associated with
this relying party |
java.util.List<Saml2X509Credential> |
getVerificationCredentials()
Deprecated.
Use {code #getAssertingPartyDetails().getSigningX509Credentials()}
instead
|
static RelyingPartyRegistration.Builder |
withRegistrationId(java.lang.String registrationId)
Creates a
RelyingPartyRegistration RelyingPartyRegistration.AssertingPartyDetails.Builder with a known
registrationId |
static RelyingPartyRegistration.Builder |
withRelyingPartyRegistration(RelyingPartyRegistration registration)
Creates a
RelyingPartyRegistration RelyingPartyRegistration.AssertingPartyDetails.Builder based on an existing
object |
public java.lang.String getRegistrationId()
public java.lang.String getEntityId()
Equivalent to the value found in the relying party's <EntityDescriptor EntityID="..."/>
This value may contain a number of placeholders, which need to be resolved before
use. They are baseUrl
, registrationId
, baseScheme
,
baseHost
, and basePort
.
public java.lang.String getAssertionConsumerServiceLocation()
baseUrl
, registrationId
, baseScheme
,
baseHost
, and basePort
.public Saml2MessageBinding getAssertionConsumerServiceBinding()
public java.util.Collection<Saml2X509Credential> getDecryptionX509Credentials()
Collection
of decryption Saml2X509Credential
s associated
with this relying partyCollection
of decryption Saml2X509Credential
s
associated with this relying partypublic java.util.Collection<Saml2X509Credential> getSigningX509Credentials()
Collection
of signing Saml2X509Credential
s associated with
this relying partyCollection
of signing Saml2X509Credential
s associated
with this relying partypublic RelyingPartyRegistration.AssertingPartyDetails getAssertingPartyDetails()
RelyingPartyRegistration.AssertingPartyDetails
@Deprecated public java.lang.String getRemoteIdpEntityId()
RelyingPartyRegistration.AssertingPartyDetails.getEntityId()
from
getAssertingPartyDetails()
@Deprecated public java.lang.String getAssertionConsumerServiceUrlTemplate()
getAssertionConsumerServiceLocation()
insteadbaseUrl
, registrationId
, baseScheme
,
baseHost
, and basePort
.@Deprecated public java.lang.String getIdpWebSsoUrl()
RelyingPartyRegistration.AssertingPartyDetails.getSingleSignOnServiceLocation()
from
getAssertingPartyDetails()
@Deprecated public RelyingPartyRegistration.ProviderDetails getProviderDetails()
getAssertingPartyDetails()
instead@Deprecated public java.lang.String getLocalEntityIdTemplate()
getEntityId()
insteadbaseUrl
, registrationId
, baseScheme
,
baseHost
, and basePort
, for example
{baseUrl}/saml2/service-provider-metadata/{registrationId}
@Deprecated public java.util.List<Saml2X509Credential> getCredentials()
@Deprecated public java.util.List<Saml2X509Credential> getVerificationCredentials()
Saml2X509Credential.Saml2X509CredentialType.VERIFICATION
.
Returns an empty list of credentials are not found@Deprecated public java.util.List<Saml2X509Credential> getSigningCredentials()
getSigningX509Credentials()
insteadSaml2X509Credential.Saml2X509CredentialType.SIGNING
.
Returns an empty list of credentials are not found@Deprecated public java.util.List<Saml2X509Credential> getEncryptionCredentials()
RelyingPartyRegistration.AssertingPartyDetails.getEncryptionX509Credentials()
insteadSaml2X509Credential.Saml2X509CredentialType.ENCRYPTION
.
Returns an empty list of credentials are not found@Deprecated public java.util.List<Saml2X509Credential> getDecryptionCredentials()
getDecryptionX509Credentials()
insteadSaml2X509Credential.Saml2X509CredentialType.DECRYPTION
.
Returns an empty list of credentials are not foundpublic static RelyingPartyRegistration.Builder withRegistrationId(java.lang.String registrationId)
RelyingPartyRegistration
RelyingPartyRegistration.AssertingPartyDetails.Builder
with a known
registrationId
registrationId
- a string identifier for the RelyingPartyRegistration
Builder
to create a RelyingPartyRegistration
objectpublic static RelyingPartyRegistration.Builder withRelyingPartyRegistration(RelyingPartyRegistration registration)
RelyingPartyRegistration
RelyingPartyRegistration.AssertingPartyDetails.Builder
based on an existing
objectregistration
- the RelyingPartyRegistration
Builder
to create a RelyingPartyRegistration
object