Class DefaultRelyingPartyConfigurationResolver
java.lang.Object
net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent
net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent
net.shibboleth.ext.spring.service.AbstractServiceableComponent<RelyingPartyConfigurationResolver>
net.shibboleth.idp.relyingparty.impl.DefaultRelyingPartyConfigurationResolver
- All Implemented Interfaces:
RelyingPartyConfigurationResolver
,Component
,DestructableComponent
,IdentifiableComponent
,IdentifiedComponent
,InitializableComponent
,Resolver<RelyingPartyConfiguration,
,ProfileRequestContext> ServiceableComponent<RelyingPartyConfigurationResolver>
,Aware
,ApplicationContextAware
public class DefaultRelyingPartyConfigurationResolver
extends AbstractServiceableComponent<RelyingPartyConfigurationResolver>
implements RelyingPartyConfigurationResolver
Retrieves a per-relying party configuration for a given profile request based on the request context.
Note that this resolver does not permit more than one RelyingPartyConfiguration
with the same ID.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate RelyingPartyConfiguration
Default relying party configuration, used if no other verified configuration matches.private SecurityConfiguration
A global default security configuration.private List<Credential>
The global list of all configured encryption credentials.private final org.slf4j.Logger
Class logger.private List<RelyingPartyConfiguration>
Registered relying party configurations.private List<Credential>
The global list of all configured signing credentials.private RelyingPartyConfiguration
Unverified relying party configuration, used if the request is unverified.private Predicate<ProfileRequestContext>
The predicate which decides if this request is "verified". -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Get theRelyingPartyConfiguration
to use if no other verified configuration is acceptable.getDefaultSecurityConfiguration
(String profileId) Return the default security configuration for the profile.Get the list of all configured encryption credentials.Get an unmodifiable list of verified relying party configurations.Get the list of all configured signing credentials.Get theRelyingPartyConfiguration
to use if the configuration is found to be "unverified" (via use ofgetVerificationPredicate()
).Get the definition of what a verified request is.resolve
(ProfileRequestContext context) resolveSingle
(ProfileRequestContext context) void
setDefaultConfiguration
(RelyingPartyConfiguration configuration) Set theRelyingPartyConfiguration
to use if no other verified configuration is acceptable.void
Set the global defaultSecurityConfiguration
.void
setEncryptionCredentials
(List<RelyingPartyResolverCredentialHolder> credentials) Set the list of all configured encryption credentials.void
Set the verified relying party configurations.void
setSigningCredentials
(List<RelyingPartyResolverCredentialHolder> credentials) Set the list of all configured signing credentials.void
setUnverifiedConfiguration
(RelyingPartyConfiguration configuration) Set theRelyingPartyConfiguration
to use if the configuration is found to be "unverified" (via use ofgetVerificationPredicate()
).void
setVerificationPredicate
(Predicate<ProfileRequestContext> predicate) Set the definition of what a verified request is.Methods inherited from class net.shibboleth.ext.spring.service.AbstractServiceableComponent
doDestroy, getApplicationContext, pinComponent, setApplicationContext, unloadComponent, unpinComponent
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent
setId
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent
getId
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, initialize, isDestroyed, isInitialized
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.shibboleth.utilities.java.support.component.IdentifiedComponent
getId
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
rpConfigurations
Registered relying party configurations. -
unverifiedConfiguration
Unverified relying party configuration, used if the request is unverified. -
defaultConfiguration
Default relying party configuration, used if no other verified configuration matches. -
verificationPredicate
The predicate which decides if this request is "verified". -
defaultSecurityConfiguration
A global default security configuration. -
signingCredentials
The global list of all configured signing credentials. -
encryptionCredentials
The global list of all configured encryption credentials.
-
-
Constructor Details
-
DefaultRelyingPartyConfigurationResolver
public DefaultRelyingPartyConfigurationResolver()Constructor.
-
-
Method Details
-
getRelyingPartyConfigurations
@Nonnull @NonnullElements @Unmodifiable @NotLive public List<RelyingPartyConfiguration> getRelyingPartyConfigurations()Get an unmodifiable list of verified relying party configurations.- Returns:
- unmodifiable list of verified relying party configurations
-
setRelyingPartyConfigurations
public void setRelyingPartyConfigurations(@Nonnull @NonnullElements List<RelyingPartyConfiguration> configs) Set the verified relying party configurations.- Parameters:
configs
- list of verified relying party configurations
-
getDefaultConfiguration
Get theRelyingPartyConfiguration
to use if no other verified configuration is acceptable.- Returns:
- default verified configuration
-
setDefaultConfiguration
Set theRelyingPartyConfiguration
to use if no other verified configuration is acceptable.- Parameters:
configuration
- default verified configuration
-
getUnverifiedConfiguration
Get theRelyingPartyConfiguration
to use if the configuration is found to be "unverified" (via use ofgetVerificationPredicate()
).- Returns:
- unverified configuration
-
setUnverifiedConfiguration
Set theRelyingPartyConfiguration
to use if the configuration is found to be "unverified" (via use ofgetVerificationPredicate()
).- Parameters:
configuration
- unverified configuration
-
getVerificationPredicate
Get the definition of what a verified request is.- Returns:
- predicate for determination whether request is verified
-
setVerificationPredicate
Set the definition of what a verified request is.- Parameters:
predicate
- predicate to set
-
setDefaultSecurityConfiguration
Set the global defaultSecurityConfiguration
.- Parameters:
config
- global default
-
doInitialize
- Overrides:
doInitialize
in classAbstractServiceableComponent<RelyingPartyConfigurationResolver>
- Throws:
ComponentInitializationException
-
resolve
@Nonnull @NonnullElements public Iterable<RelyingPartyConfiguration> resolve(@Nullable ProfileRequestContext context) throws ResolverException - Specified by:
resolve
in interfaceResolver<RelyingPartyConfiguration,
ProfileRequestContext> - Throws:
ResolverException
-
resolveSingle
@Nullable public RelyingPartyConfiguration resolveSingle(@Nullable ProfileRequestContext context) throws ResolverException - Specified by:
resolveSingle
in interfaceResolver<RelyingPartyConfiguration,
ProfileRequestContext> - Throws:
ResolverException
-
getDefaultSecurityConfiguration
@Nullable public SecurityConfiguration getDefaultSecurityConfiguration(@Nonnull @NotEmpty String profileId) Return the default security configuration for the profile.- Specified by:
getDefaultSecurityConfiguration
in interfaceRelyingPartyConfigurationResolver
- Parameters:
profileId
- the profile ID (available viaIdentifiedComponent.getId()
- Returns:
- the configured default configuration
-
getSigningCredentials
Get the list of all configured signing credentials.- Returns:
- the list of signing credentials
-
setSigningCredentials
@Autowired @Qualifier("signing") public void setSigningCredentials(@Nullable @NonnullElements List<RelyingPartyResolverCredentialHolder> credentials) Set the list of all configured signing credentials.- Parameters:
credentials
- the list of signing credentials, may be null
-
getEncryptionCredentials
Get the list of all configured encryption credentials.- Returns:
- the list of encryption credentials
-
setEncryptionCredentials
@Autowired @Qualifier("encryption") public void setEncryptionCredentials(@Nullable @NonnullElements List<RelyingPartyResolverCredentialHolder> credentials) Set the list of all configured encryption credentials.- Parameters:
credentials
- the list of encryption credentials, may be null
-
getComponent
- Specified by:
getComponent
in interfaceServiceableComponent<RelyingPartyConfigurationResolver>
- Specified by:
getComponent
in classAbstractServiceableComponent<RelyingPartyConfigurationResolver>
-