Class RelyingPartyRegistrations
Makes RelyingPartyRegistrations from an identity provider's metadata and
from the configuration.
In application.properties, as Spring Boot spells them under
spring.security.saml2.relyingparty:
cn1.security.saml2.relyingparty.registration.okta.assertingparty.metadata-uri=https://corp.okta.com/app/exk.../sso/saml/metadata
or, without metadata:
cn1.security.saml2.relyingparty.registration.adfs.assertingparty.entity-id=http://adfs.corp.example/adfs/services/trust
cn1.security.saml2.relyingparty.registration.adfs.assertingparty.singlesignon.url=https://adfs.corp.example/adfs/ls/
cn1.security.saml2.relyingparty.registration.adfs.assertingparty.singlesignon.binding=POST
cn1.security.saml2.relyingparty.registration.adfs.assertingparty.verification.certificate-location=/etc/app/adfs.crt
Each registration may also set entity-id, acs.location,
name-id-format, sha1-allowed, clock-skew-seconds,
assertingparty.singlesignon.sign-request,
signing.private-key-location with signing.certificate-location,
decryption.private-key-location with decryption.certificate-location
(comma separated lists, in pairs, for a rollover),
assertingparty.singlelogout.url, .response-url and .binding, and
singlelogout.url and singlelogout.response-url for this side.
A setting beside metadata-uri overrides what the metadata says.
Metadata is trusted as it is fetched -- over HTTPS, or from a file the operator put there -- and a signature on it is not checked, as Spring Security does not by default. Its certificates are what every response is then held to, so the address must be one only the identity provider controls.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe prefix of every registration's settings. -
Method Summary
Modifier and TypeMethodDescriptionstatic List<RelyingPartyRegistration> fromConfig(Config config) The registrations the configuration declares; empty when it declares none.fromMetadata(String metadata, String registrationId) A builder filled in from the identity provider's metadata document.fromMetadataLocation(String location, String registrationId) A builder filled in from the identity provider's metadata atlocation: anhttps:orhttp:address, or a file.
-
Field Details
-
REGISTRATION
-
-
Method Details
-
fromMetadataLocation
public static RelyingPartyRegistration.Builder fromMetadataLocation(String location, String registrationId) throws IOException A builder filled in from the identity provider's metadata atlocation: anhttps:orhttp:address, or a file.- Throws:
IOException
-
fromMetadata
public static RelyingPartyRegistration.Builder fromMetadata(String metadata, String registrationId) throws IOException A builder filled in from the identity provider's metadata document.
The document is an
EntityDescriptor, or anEntitiesDescriptorholding exactly one identity provider.- Throws:
IOException
-
fromConfig
The registrations the configuration declares; empty when it declares none.- Throws:
IOException
-