Class AbstractExternalAgentResolver

All Implemented Interfaces:
Component, DestructableComponent, IdentifiableComponent, IdentifiedComponent, InitializableComponent, Resolver<Agent,CriteriaSet>, AgentResolver
Direct Known Subclasses:
FlatFileExternalAgentResolver

public abstract class AbstractExternalAgentResolver extends AbstractIdentifiableInitializableComponent implements AgentResolver
Abstract component that builds Agent objects by loading information from an external source in response to queries and applying locally configured settings.

The required criteria supported are AgentIDCriterion and AgentCredentialCriterion.

Includes optional caching.

The resolver is configured with any of the possible settings that must be settable on the resulting object, which span the Agent, Application, and RelyingPartyConfiguration interfaces.

  • Field Details

  • Constructor Details

    • AbstractExternalAgentResolver

      public AbstractExternalAgentResolver(@ParameterName(name="protocolManager") @Nonnull ProtocolSupportServiceManager protocolManager)
      Constructor.
      Parameters:
      protocolManager - injected plugin capability objects
  • Method Details

    • setCacheEnabled

      public void setCacheEnabled(boolean flag)
      Sets whether to enable caching.

      Defaults to false.

      Parameters:
      flag - flag to set
    • setMaximumCachedElements

      public void setMaximumCachedElements(@Nonnull @Positive Integer max)
      Sets the maximum cache size.

      Defaults to 100.

      Parameters:
      max - maximum size
    • setExpireAfterAccess

      public void setExpireAfterAccess(@Nullable @Positive Duration exp)
      Sets the cache policy to expire entries after access, with the time reset on each access.

      Defaults to 4 hours.

      Mutually exclusive with setExpireAfterWrite(Duration).

      Parameters:
      exp - threshold
    • setExpireAfterWrite

      public void setExpireAfterWrite(@Nullable @Positive Duration exp)
      Sets the cache policy to expire entries after creation.

      Defaults to null.

      Mutually exclusive with setExpireAfterAccess(Duration).

      Parameters:
      exp - threshold
    • setAllowedAddressRanges

      public void setAllowedAddressRanges(@Nullable Set<IPRange> ranges)
      Sets the network ranges from which this loader's agents may make requests.
      Parameters:
      ranges - allowed ranges
    • setAuthenticationMethod

      public void setAuthenticationMethod(@Nullable @NotEmpty String method)
      Sets the authentication method to require for this loader's agents.

      Defaults to Agent.AUTH_METHOD_BASIC.

      Parameters:
      method - method identifier
    • setSupportsCachedAuthentication

      public void setSupportsCachedAuthentication(boolean flag)
      Sets whether this loader's agents support cached authentication via cookie.

      Defaults to true.

      Parameters:
      flag - flag to set
    • setAuthorizedUtilityOperations

      public void setAuthorizedUtilityOperations(@Nullable Collection<String> ops)
      Sets the set of "utility" operations authorized for use by this loader's agents.

      Defaults to empty.

      Parameters:
      ops - authorized operation names
    • setSupportsPostPreservation

      public void setSupportsPostPreservation(boolean flag)
      Sets whether this loader's agents are permitted to submit form data for preservation during SSO.
      Parameters:
      flag - flag to set
    • setPostLimit

      public void setPostLimit(@NonNegative long limit)
      Sets limit on size of form data to preserve.
      Parameters:
      limit - size limit or 0 for none
    • setCharacterEncoding

      public void setCharacterEncoding(@Nonnull String name)
      Sets the character encoding to apply for POST recovery.
      Parameters:
      name - name of encoding
    • setAuthenticatingAuthority

      public void setAuthenticatingAuthority(@Nullable @NotEmpty String authority)
      Sets the identifier of the authenticating authority (IdP, OP, etc.) to use for this loader's agents.
      Parameters:
      authority - authority name
    • setDiscoveryService

      public void setDiscoveryService(@Nullable String url)
      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
    • setSessionInitiators

      public void setSessionInitiators(@Nullable Collection<String> initiators)
      Sets the ordered collection of unprefixed session initiator flow IDs to use for this loader's agents.
      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 loader's agents.
      Parameters:
      strategy - lookup strategy
    • setTokenConsumers

      public void setTokenConsumers(@Nullable Collection<String> consumers)
      Sets the ordered collection of unprefixed token consumer flow IDs to use for this loader's agents.
      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 loader's agents.
      Parameters:
      strategy - lookup strategy
    • setLogoutInitiators

      public void setLogoutInitiators(@Nullable Collection<String> initiators)
      Sets the ordered collection of unprefixed logout initiator flow IDs to use for this loader's agents.
      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 loader's agents.
      Parameters:
      strategy - lookup strategy
    • setLogoutConsumers

      public void setLogoutConsumers(@Nullable Collection<String> consumers)
      Sets the ordered collection of unprefixed logout consumer flow IDs to use for this loader's agents.
      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 loader's agents.
      Parameters:
      strategy - lookup strategy
    • setLogoutAdmins

      public void setLogoutAdmins(@Nullable Collection<String> admins)
      Sets the ordered collection of unprefixed admin logout flow IDs to use for this loader's agents.
      Parameters:
      admins - ordered collection of unprefixed admin logout flow IDs
    • setLogoutAdminsLookupStrategy

      public void setLogoutAdminsLookupStrategy(@Nonnull Function<ProfileRequestContext,List<String>> strategy)
      Sets the lookup strategy for the ordered collection of unprefixed admin logout flow IDs to use for this loader's agents.
      Parameters:
      strategy - lookup strategy
    • setStateManager

      public void setStateManager(@Nonnull StateManager manager)
      Set the StateManager to use.
      Parameters:
      manager - state manager
    • setAttributeTranscoderRegistry

      public void setAttributeTranscoderRegistry(@Nonnull ReloadableService<AttributeTranscoderRegistry> service)
      Parameters:
      service - registry service
    • setAttributeResolver

      public void setAttributeResolver(@Nonnull ReloadableService<AttributeResolver> service)
      Set the AttributeResolver to use.
      Parameters:
      service - resolver service
    • setAttributeFilter

      public void setAttributeFilter(@Nonnull ReloadableService<AttributeFilter> service)
      Set the AttributeFilter to use.
      Parameters:
      service - filter service
    • 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 loader's agents.
      Parameters:
      strategy - lookup strategy
    • 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 a CredentialResolver to 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
    • setIssuer

      public void setIssuer(@Nullable @NotEmpty String issuer)
      Set the name to use when issuing messages to peers.
      Parameters:
      issuer - name to set
    • setIssuerLookupStrategy

      public void setIssuerLookupStrategy(@Nonnull Function<ProfileRequestContext,String> strategy)
      Set a lookup strategy for the name to use when issuing messages to peers.
      Parameters:
      strategy - lookup strategy
    • setDetailedErrors

      public void setDetailedErrors(boolean flag)
      Set whether detailed information about errors should be exposed.
      Parameters:
      flag - flag to set
    • setDetailedErrorsPredicate

      public void setDetailedErrorsPredicate(@Nonnull Predicate<ProfileRequestContext> condition)
      Set a condition to determine whether detailed information about errors should be exposed.
      Parameters:
      condition - condition to set
    • setSecurityConfiguration

      public void setSecurityConfiguration(@Nullable SecurityConfiguration configuration)
      Sets the security configuration for this profile.
      Parameters:
      configuration - security configuration for this profile
    • setSecurityConfigurationLookupStrategy

      public void setSecurityConfigurationLookupStrategy(@Nonnull Function<ProfileRequestContext,SecurityConfiguration> strategy)
      Set a lookup strategy for the security configuration.
      Parameters:
      strategy - lookup strategy
    • setProfileConfigurations

      public void setProfileConfigurations(@Nullable Collection<ProfileConfiguration> configs)
      Set the profile configurations for this relying party.
      Parameters:
      configs - the configurations to set
    • setProfileConfigurationsLookupStrategy

      public void setProfileConfigurationsLookupStrategy(@Nonnull Function<ProfileRequestContext,Map<String,ProfileConfiguration>> strategy)
      Set a lookup strategy for the profileConfigurations property.
      Parameters:
      strategy - lookup strategy
    • setRelyingPartyConfigurations

      public void setRelyingPartyConfigurations(@Nullable Collection<? extends RelyingPartyConfiguration> configs)
      Set the verified relying party configurations.
      Parameters:
      configs - list of verified relying party configurations
    • setUnverifiedConfiguration

      public void setUnverifiedConfiguration(@Nullable RelyingPartyConfiguration configuration)
      Set the RelyingPartyConfiguration to use if the configuration is found to be "unverified" (via use of VerifiedProfileCriterion).
      Parameters:
      configuration - unverified configuration
    • setMetricName

      public void setMetricName(@Nullable String name)
      Set name of metric to use for counters to track use of configurations.
      Parameters:
      name - name for counter metrics
    • doInitialize

      protected void doInitialize() throws ComponentInitializationException
      Overrides:
      doInitialize in class AbstractIdentifiedInitializableComponent
      Throws:
      ComponentInitializationException
    • resolveSingle

      @Nullable public Agent resolveSingle(@Nullable CriteriaSet criteria) throws ResolverException
      Specified by:
      resolveSingle in interface Resolver<Agent,CriteriaSet>
      Throws:
      ResolverException
    • resolve

      @Nonnull public Iterable<Agent> resolve(@Nullable CriteriaSet criteria) throws ResolverException
      Specified by:
      resolve in interface Resolver<Agent,CriteriaSet>
      Throws:
      ResolverException
    • doResolve

      @Nullable public abstract AbstractExternalAgentResolver.AgentTemplate doResolve(@Nonnull CriteriaSet criteria) throws ResolverException
      Performs resolution of a specific named agent record in the form of a template object which the base class will fully configure and resolve.
      Parameters:
      criteria - resolution criteria
      Returns:
      agent template record or null if absent
      Throws:
      ResolverException - if an error occurs