Class OpenSaml4AssertingPartyMetadataRepository
java.lang.Object
org.springframework.security.saml2.provider.service.registration.OpenSaml4AssertingPartyMetadataRepository
- All Implemented Interfaces:
Iterable<AssertingPartyMetadata>,AssertingPartyMetadataRepository
public final class OpenSaml4AssertingPartyMetadataRepository
extends Object
implements AssertingPartyMetadataRepository
An implementation of
AssertingPartyMetadataRepository that uses a
MetadataResolver to retrieve AssertingPartyMetadata instances.
The MetadataResolver constructed in withTrustedMetadataLocation(java.lang.String)
provides expiry-aware refreshing.
- Since:
- 6.4
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA builder class for configuringOpenSaml4AssertingPartyMetadataRepositoryfor a specific metadata location. -
Constructor Summary
ConstructorsConstructorDescriptionOpenSaml4AssertingPartyMetadataRepository(org.opensaml.saml.metadata.resolver.MetadataResolver metadataResolver) Construct anOpenSaml4AssertingPartyMetadataRepositoryusing the providedMetadataResolver. -
Method Summary
Modifier and TypeMethodDescriptionfindByEntityId(String entityId) Retrieve anAssertingPartyMetadataby its EntityID.iterator()withMetadataLocation(String metadataLocation) Use thismetadataLocationto retrieve refreshable, expiry-aware SAML 2.0 Asserting Party (IDP) metadata.withTrustedMetadataLocation(String metadataLocation) Use this trustedmetadataLocationto retrieve refreshable, expiry-aware SAML 2.0 Asserting Party (IDP) metadata.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
OpenSaml4AssertingPartyMetadataRepository
public OpenSaml4AssertingPartyMetadataRepository(org.opensaml.saml.metadata.resolver.MetadataResolver metadataResolver) Construct anOpenSaml4AssertingPartyMetadataRepositoryusing the providedMetadataResolver.The
MetadataResolvershould either be of typeIterableMetadataSourceor it should have aRoleMetadataIndexconfigured.- Parameters:
metadataResolver- theMetadataResolverto use
-
-
Method Details
-
iterator
- Specified by:
iteratorin interfaceIterable<AssertingPartyMetadata>
-
findByEntityId
Retrieve anAssertingPartyMetadataby its EntityID.- Specified by:
findByEntityIdin interfaceAssertingPartyMetadataRepository- Parameters:
entityId- the EntityID to lookup- Returns:
- the found
AssertingPartyMetadata, ornullotherwise
-
withTrustedMetadataLocation
public static OpenSaml4AssertingPartyMetadataRepository.MetadataLocationRepositoryBuilder withTrustedMetadataLocation(String metadataLocation) Use this trustedmetadataLocationto retrieve refreshable, expiry-aware SAML 2.0 Asserting Party (IDP) metadata.Valid locations can be classpath- or file-based or they can be HTTPS endpoints. Some valid endpoints might include:
metadataLocation = "classpath:asserting-party-metadata.xml"; metadataLocation = "file:asserting-party-metadata.xml"; metadataLocation = "https://ap.example.org/metadata";
Resolution of location is attempted immediately. To defer, wrap in
CachingRelyingPartyRegistrationRepository.- Parameters:
metadataLocation- the classpath- or file-based locations or HTTPS endpoints of the asserting party metadata file- Returns:
- the
OpenSaml4AssertingPartyMetadataRepository.MetadataLocationRepositoryBuilderfor further configuration
-
withMetadataLocation
public static OpenSaml4AssertingPartyMetadataRepository.MetadataLocationRepositoryBuilder withMetadataLocation(String metadataLocation) Use thismetadataLocationto retrieve refreshable, expiry-aware SAML 2.0 Asserting Party (IDP) metadata. Verification credentials are required.Valid locations can be classpath- or file-based or they can be remote endpoints. Some valid endpoints might include:
metadataLocation = "classpath:asserting-party-metadata.xml"; metadataLocation = "file:asserting-party-metadata.xml"; metadataLocation = "https://ap.example.org/metadata";
Resolution of location is attempted immediately. To defer, wrap in
CachingRelyingPartyRegistrationRepository.- Parameters:
metadataLocation- the classpath- or file-based locations or remote endpoints of the asserting party metadata file- Returns:
- the
OpenSaml4AssertingPartyMetadataRepository.MetadataLocationRepositoryBuilderfor further configuration
-