Package net.shibboleth.sp.impl
Class BasicApplication
- All Implemented Interfaces:
Predicate<ProfileRequestContext>,RelyingPartyConfiguration,RelyingPartyConfigurationResolver,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,Resolver<RelyingPartyConfiguration,,CriteriaSet> Application
- Direct Known Subclasses:
BasicAgent
Basic implementation of an
Application.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate final classSubclass of default resolver that allows us to hook the configuration object getter methods to allow them to be inheritance-aware. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanWhether inheritable settings should inherit from the parent.private ReloadableService<AttributeFilter>Attribute filter.private ReloadableService<AttributeResolver>Attribute resolver.private Function<ProfileRequestContext,String> Lookup strategy for authenticating authority.private booleanFlag indicating whether authority setting was explicitly set.private CredentialResolverAccess to credentials indirectly.private Function<ProfileRequestContext,String> Discovery service lookup strategy.private booleanFlag indicating whether discovery setting was explicitly set.private final org.slf4j.LoggerClass logger.private Function<ProfileRequestContext,List<String>> Logout consumer list lookup strategy.private Function<ProfileRequestContext,List<String>> Logout initiator list lookup strategy.private ApplicationLink to parentApplication.(package private) final ProtocolSupportServiceManagerManager of protocol auto-registration material.(package private) Map<String,ProtocolSupportService> Map of protocol support services.Our self-managed "defaults".private Function<ProfileRequestContext,List<String>> Session initiator list lookup strategy.private StateManagerState management.private Function<ProfileRequestContext,List<String>> Token consumer list lookup strategy.Transcoding registry. -
Constructor Summary
ConstructorsConstructorDescriptionBasicApplication(ProtocolSupportServiceManager protocolManager) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbooleanDedicated method to access application ID for explicitness.GetsAttributeFilterfor thisApplication.GetsAttributeResolverfor thisApplication.GetsAttributeTranscoderRegistryfor thisApplication.getAuthenticatingAuthority(ProfileRequestContext profileRequestContext) Gets the identifier of the authenticating authority (IdP, OP, etc.) to use for this application if not overridden.getDiscoveryService(ProfileRequestContext profileRequestContext) [Gets the discovery service URL to use in the event a session initiator cannot be executed.getIssuer(ProfileRequestContext profileRequestContext) getLogoutConsumers(ProfileRequestContext profileRequestContext) Gets an ordered list of logout consumer flows to attempt for this application.getLogoutInitiators(ProfileRequestContext profileRequestContext) Gets an ordered list of logout initiator flows to attempt for this application.Gets the parentApplicationfor inheritance-purposes.getProfileConfiguration(ProfileRequestContext profileRequestContext, String profileId) getProfileConfigurations(ProfileRequestContext profileRequestContext) <T extends ProtocolSupportService>
TgetProtocolSupportService(String protocol, Class<T> claz) Gets theProtocolSupportServicesubtype for a particular protocol.getSecurityConfiguration(ProfileRequestContext profileRequestContext) getSessionInitiators(ProfileRequestContext profileRequestContext) Gets an ordered list of session initiator flows to attempt for this application.Gets theStateManagerto use for thie application.getTokenConsumers(ProfileRequestContext profileRequestContext) Gets an ordered list of token consumer flows to attempt for this application.inthashCode()booleanGets whether to inherit some settings from parent if one exists.resolve(CriteriaSet criteria) resolveSingle(CriteriaSet criteria) voidsetAllowInheritance(boolean flag) Sets whether to inherit some settings from parent if one exists.voidSet theAttributeFilterto use.voidSet theAttributeResolverto use.voidSet theAttributeTranscoderRegistryto use.voidsetAuthenticatingAuthority(String authority) Sets the identifier of the authenticating authority (IdP, OP, etc.) to use for this application if not overridden.voidSets the lookup strategy for the identifier of the authenticating authority (IdP, OP, etc.) to use for this application if not overridden.voidsetCredentialResolver(CredentialResolver resolver) Deprecated, for removal: This API element is subject to removal in a future version.voidsetDefaultConfiguration(RelyingPartyConfiguration configuration) Set theRelyingPartyConfigurationto use if no other configuration is applicable.voidSets the discovery service URL to use in the event a session initiator cannot be executed.voidSets the lookup strategy for the discovery service URL to use in the event a session initiator cannot be executed.voidsetEncryptionCredentials(List<CredentialHolder> credentials) Set the list of all configured encryption credentials.voidsetLogoutConsumers(Collection<String> consumers) Sets the ordered collection of unprefixed logout consumer flow IDs to use for this application.voidSets the lookup strategy for the ordered collection of unprefixed logout consumer flow IDs to use for this application.voidsetLogoutInitiators(Collection<String> initiators) Sets the ordered collection of unprefixed logout initiator flow IDs to use for this application.voidSets the lookup strategy for the ordered collection of unprefixed logout initiator flow IDs to use for this application.voidsetMetricName(String name) Set name of metric to use for counters to track use of configurations.voidsetParent(Application app) Sets the parentApplicationfor inheritance-purposes.voidSets overriddenProtocolSupportServiceinstances for specific protocols.voidsetRelyingPartyConfigurations(Collection<? extends RelyingPartyConfiguration> configs) Set the verified relying party configurations.voidsetSessionInitiators(Collection<String> initiators) Sets the ordered collection of unprefixed session initiator flow IDs to use for this application.voidSets the lookup strategy for the ordered collection of unprefixed session initiator flow IDs to use for this application.voidsetSigningCredentials(List<CredentialHolder> credentials) Set the list of all configured signing credentials.voidsetStateManager(StateManager manager) Set theStateManagerto use.voidsetTokenConsumers(Collection<String> consumers) Sets the ordered collection of unprefixed token consumer flow IDs to use for this application.voidSets the lookup strategy for the ordered collection of unprefixed token consumer flow IDs to use for this application.voidsetUnverifiedConfiguration(RelyingPartyConfiguration configuration) Set theRelyingPartyConfigurationto use if the configuration is found to be "unverified" (via use ofVerifiedProfileCriterion).toString()Methods inherited from class net.shibboleth.profile.relyingparty.BasicRelyingPartyConfiguration
isDetailedErrors, setActivationCondition, setDetailedErrors, setDetailedErrorsPredicate, setIssuer, setIssuerLookupStrategy, setProfileConfigurations, setProfileConfigurationsLookupStrategy, setResponderId, setResponderIdLookupStrategy, setSecurityConfiguration, setSecurityConfigurationLookupStrategy, testMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
setIdMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentExceptionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getIdMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitializedMethods inherited from interface net.shibboleth.profile.relyingparty.RelyingPartyConfiguration
isDetailedErrors, setResponderId
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
parent
Link to parentApplication. -
allowInheritance
private boolean allowInheritanceWhether inheritable settings should inherit from the parent. -
relyingPartyResolver
@NonnullAfterInit private BasicApplication.ApplicationAwareRelyingPartyResolver relyingPartyResolverOur self-managed "defaults". -
protocolServiceManager
Manager of protocol auto-registration material. -
protocolServiceMap
Map of protocol support services. -
discoverySet
private boolean discoverySetFlag indicating whether discovery setting was explicitly set. -
authoritySet
private boolean authoritySetFlag indicating whether authority setting was explicitly set. -
authenticatingAuthorityLookupStrategy
Lookup strategy for authenticating authority. -
sessionInitiatorLookupStrategy
@NonnullAfterInit private Function<ProfileRequestContext,List<String>> sessionInitiatorLookupStrategySession initiator list lookup strategy. -
discoveryServiceLookupStrategy
Discovery service lookup strategy. -
tokenConsumerLookupStrategy
Token consumer list lookup strategy. -
logoutInitiatorLookupStrategy
@NonnullAfterInit private Function<ProfileRequestContext,List<String>> logoutInitiatorLookupStrategyLogout initiator list lookup strategy. -
logoutConsumerLookupStrategy
Logout consumer list lookup strategy. -
stateManager
State management. -
transcodingRegistry
Transcoding registry. -
attributeResolver
Attribute resolver. -
attributeFilter
Attribute filter. -
credentialResolver
Access to credentials indirectly.
-
-
Constructor Details
-
BasicApplication
public BasicApplication(@ParameterName(name="protocolManager") @Nonnull ProtocolSupportServiceManager protocolManager) Constructor.- Parameters:
protocolManager- injected plugin capability objects
-
-
Method Details
-
getApplicationId
Dedicated method to access application ID for explicitness.- Specified by:
getApplicationIdin interfaceApplication- Returns:
- application ID
-
isAllowInheritance
public boolean isAllowInheritance()Gets whether to inherit some settings from parent if one exists.- Returns:
- true iff settings that can be inherited from parent should be
-
setAllowInheritance
public void setAllowInheritance(boolean flag) Sets whether to inherit some settings from parent if one exists.Defaults to true.
- Parameters:
flag- flag to set
-
getParent
Gets the parentApplicationfor inheritance-purposes.- Returns:
- app parent
Applicationor null
-
setParent
Sets the parentApplicationfor inheritance-purposes.- Parameters:
app- parentApplicationor null
-
getAuthenticatingAuthority
@Nullable @NotEmpty public String getAuthenticatingAuthority(@Nullable ProfileRequestContext profileRequestContext) Gets the identifier of the authenticating authority (IdP, OP, etc.) to use for this application if not overridden.- Specified by:
getAuthenticatingAuthorityin interfaceApplication- Parameters:
profileRequestContext- current profile request context- Returns:
- authenticating authority
-
setAuthenticatingAuthority
Sets the identifier of the authenticating authority (IdP, OP, etc.) to use for this application if not overridden.- Parameters:
authority- authority name
-
setAuthenticatingAuthorityLookupStrategy
public void setAuthenticatingAuthorityLookupStrategy(@Nonnull Function<ProfileRequestContext, String> strategy) Sets the lookup strategy for the identifier of the authenticating authority (IdP, OP, etc.) to use for this application if not overridden.- Parameters:
strategy- lookup strategy
-
getDiscoveryService
[Gets the discovery service URL to use in the event a session initiator cannot be executed.In the absence of a value, the Hub will not attempt IdP discovery and session initiator requests that cannot be associated with a recognized authority to use will fail.
- Specified by:
getDiscoveryServicein interfaceApplication- Parameters:
profileRequestContext- profile request context- Returns:
- discovery service location, or null
-
setDiscoveryService
Sets the discovery service URL to use in the event a session initiator cannot be executed.- Parameters:
url- discovery service URL
-
setDiscoveryServiceLookupStrategy
public void setDiscoveryServiceLookupStrategy(@Nonnull Function<ProfileRequestContext, String> strategy) Sets the lookup strategy for the discovery service URL to use in the event a session initiator cannot be executed.- Parameters:
strategy- lookup strategy
-
getSessionInitiators
@Nonnull public List<String> getSessionInitiators(@Nullable ProfileRequestContext profileRequestContext) Gets an ordered list of session initiator flows to attempt for this application.- Specified by:
getSessionInitiatorsin interfaceApplication- Parameters:
profileRequestContext- profile request context- Returns:
- ordered list of unprefixed flow IDs
-
setSessionInitiators
Sets the ordered collection of unprefixed session initiator flow IDs to use for this application.- Parameters:
initiators- ordered collection of unprefixed session initiator flow IDs
-
setSessionInitiatorsLookupStrategy
public void setSessionInitiatorsLookupStrategy(@Nonnull Function<ProfileRequestContext, List<String>> strategy) Sets the lookup strategy for the ordered collection of unprefixed session initiator flow IDs to use for this application.- Parameters:
strategy- lookup strategy
-
getTokenConsumers
@Nonnull public List<String> getTokenConsumers(@Nullable ProfileRequestContext profileRequestContext) Gets an ordered list of token consumer flows to attempt for this application.- Specified by:
getTokenConsumersin interfaceApplication- Parameters:
profileRequestContext- profile request context- Returns:
- ordered list of unprefixed flow IDs
-
setTokenConsumers
Sets the ordered collection of unprefixed token consumer flow IDs to use for this application.- Parameters:
consumers- ordered collection of unprefixed token consumer flow IDs
-
setTokenConsumersLookupStrategy
public void setTokenConsumersLookupStrategy(@Nonnull Function<ProfileRequestContext, List<String>> strategy) Sets the lookup strategy for the ordered collection of unprefixed token consumer flow IDs to use for this application.- Parameters:
strategy- lookup strategy
-
getLogoutInitiators
@Nonnull public List<String> getLogoutInitiators(@Nullable ProfileRequestContext profileRequestContext) Gets an ordered list of logout initiator flows to attempt for this application.- Specified by:
getLogoutInitiatorsin interfaceApplication- Parameters:
profileRequestContext- profile request context- Returns:
- ordered list of unprefixed flow IDs
-
setLogoutInitiators
Sets the ordered collection of unprefixed logout initiator flow IDs to use for this application.- Parameters:
initiators- ordered collection of unprefixed logout initiator flow IDs
-
setLogoutInitiatorsLookupStrategy
public void setLogoutInitiatorsLookupStrategy(@Nonnull Function<ProfileRequestContext, List<String>> strategy) Sets the lookup strategy for the ordered collection of unprefixed logout initiator flow IDs to use for this application.- Parameters:
strategy- lookup strategy
-
getLogoutConsumers
@Nonnull public List<String> getLogoutConsumers(@Nullable ProfileRequestContext profileRequestContext) Gets an ordered list of logout consumer flows to attempt for this application.- Specified by:
getLogoutConsumersin interfaceApplication- Parameters:
profileRequestContext- profile request context- Returns:
- ordered list of unprefixed flow IDs
-
setLogoutConsumers
Sets the ordered collection of unprefixed logout consumer flow IDs to use for this application.- Parameters:
consumers- ordered collection of unprefixed logout consumer flow IDs
-
setLogoutConsumersLookupStrategy
public void setLogoutConsumersLookupStrategy(@Nonnull Function<ProfileRequestContext, List<String>> strategy) Sets the lookup strategy for the ordered collection of unprefixed logout consumer flow IDs to use for this application.- Parameters:
strategy- lookup strategy
-
getStateManager
Gets theStateManagerto use for thie application.- Specified by:
getStateManagerin interfaceApplication- Returns:
- the manager to use
-
setStateManager
Set theStateManagerto use.- Parameters:
manager- state manager
-
getAttributeTranscoderRegistry
GetsAttributeTranscoderRegistryfor thisApplication.- Specified by:
getAttributeTranscoderRegistryin interfaceApplication- Returns:
- the attribute transcoder registry to use
-
getAttributeResolver
GetsAttributeResolverfor thisApplication.- Specified by:
getAttributeResolverin interfaceApplication- Returns:
- the attribute resolver to use
-
getAttributeFilter
GetsAttributeFilterfor thisApplication.- Specified by:
getAttributeFilterin interfaceApplication- Returns:
- the attribute filter to use
-
getProtocolSupportService
@Nullable public <T extends ProtocolSupportService> T getProtocolSupportService(@Nonnull @NotEmpty String protocol, @Nonnull Class<T> claz) Gets theProtocolSupportServicesubtype for a particular protocol.- Specified by:
getProtocolSupportServicein interfaceApplication- Type Parameters:
T- the type of service- Parameters:
protocol- protocol to fetchclaz- type to fetch- Returns:
- the corresponding service object or null
-
setProtocolSupportServices
Sets overriddenProtocolSupportServiceinstances for specific protocols.This collection overlays any default-installed instamces so it will merge the overrides into the default map and leave any other instances alone.
- Parameters:
services- service information to override
-
setCredentialResolver
@Deprecated(since="1.0.0", forRemoval=true) public void setCredentialResolver(@Nullable CredentialResolver resolver) Deprecated, for removal: This API element is subject to removal in a future version.Sets aCredentialResolverto use for resolving keys and certificates "indirectly" in support of the deprecated older methods.This method should not be relied on "publically", and is solely used internally for backward compatibility.
- Parameters:
resolver- credential resolver
-
getIssuer
- Specified by:
getIssuerin interfaceRelyingPartyConfiguration- Overrides:
getIssuerin classBasicRelyingPartyConfiguration
-
getSecurityConfiguration
@Nullable public SecurityConfiguration getSecurityConfiguration(@Nullable ProfileRequestContext profileRequestContext) - Specified by:
getSecurityConfigurationin interfaceRelyingPartyConfiguration- Overrides:
getSecurityConfigurationin classBasicRelyingPartyConfiguration
-
getProfileConfigurations
@Nonnull public Map<String,ProfileConfiguration> getProfileConfigurations(@Nullable ProfileRequestContext profileRequestContext) - Specified by:
getProfileConfigurationsin interfaceRelyingPartyConfiguration- Overrides:
getProfileConfigurationsin classBasicRelyingPartyConfiguration
-
getProfileConfiguration
@Nullable public ProfileConfiguration getProfileConfiguration(@Nullable ProfileRequestContext profileRequestContext, @Nullable String profileId) - Specified by:
getProfileConfigurationin interfaceRelyingPartyConfiguration- Overrides:
getProfileConfigurationin classBasicRelyingPartyConfiguration
-
doInitialize
- Overrides:
doInitializein classAbstractIdentifiedInitializableComponent- Throws:
ComponentInitializationException
-
hashCode
public int hashCode() -
equals
-
toString
-
getSigningCredentials
- Specified by:
getSigningCredentialsin interfaceRelyingPartyConfigurationResolver
-
getEncryptionCredentials
- Specified by:
getEncryptionCredentialsin interfaceRelyingPartyConfigurationResolver
-
setRelyingPartyConfigurations
public void setRelyingPartyConfigurations(@Nullable Collection<? extends RelyingPartyConfiguration> configs) Set the verified relying party configurations.- Parameters:
configs- list of verified relying party configurations
-
setDefaultConfiguration
Set theRelyingPartyConfigurationto use if no other configuration is applicable.- Parameters:
configuration- default configuration
-
setUnverifiedConfiguration
Set theRelyingPartyConfigurationto use if the configuration is found to be "unverified" (via use ofVerifiedProfileCriterion).- Parameters:
configuration- unverified configuration
-
setMetricName
Set name of metric to use for counters to track use of configurations.- Parameters:
name- name for counter metrics
-
setSigningCredentials
@Autowired @Qualifier("signing") public void setSigningCredentials(@Nullable List<CredentialHolder> credentials) Set the list of all configured signing credentials.- Parameters:
credentials- the list of signing credentials, may be null
-
setEncryptionCredentials
@Autowired @Qualifier("encryption") public void setEncryptionCredentials(@Nullable List<CredentialHolder> credentials) Set the list of all configured encryption credentials.- Parameters:
credentials- the list of encryption credentials, may be null
-