Class BasicRelyingPartyConfiguration

All Implemented Interfaces:
Predicate<ProfileRequestContext>, RelyingPartyConfiguration, Component, DestructableComponent, IdentifiableComponent, IdentifiedComponent, InitializableComponent

public class BasicRelyingPartyConfiguration extends AbstractIdentifiableInitializableComponent implements RelyingPartyConfiguration, Predicate<ProfileRequestContext>
The configuration that applies to a peer with which the software is communicating.

The name "Relying Party" is historical and encompasses both sources and consumers of identity information.

Since:
5.0.0
  • Field Details

  • Constructor Details

    • BasicRelyingPartyConfiguration

      public BasicRelyingPartyConfiguration()
      Constructor.
  • Method Details

    • getIssuer

      @Nullable @NotEmpty public String getIssuer(@Nullable ProfileRequestContext profileRequestContext)
      Get the name to use when issuing messages to peers.

      In SAML this is an "entityID", in other protocols it may have other labels.

      Specified by:
      getIssuer in interface RelyingPartyConfiguration
      Parameters:
      profileRequestContext - current profile request context
      Returns:
      name to use when issuing messages
    • setIssuer

      public void setIssuer(@Nullable @NotEmpty String issuer)
      Set the name to use when issuing messages to peers.
      Parameters:
      issuer - name to set
      Since:
      5.0.0
    • 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
      Since:
      5.0.0
    • setResponderId

      @Deprecated(since="5.0.0", forRemoval=true) public void setResponderId(@Nullable @NotEmpty String issuer)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Legacy property setter for issuer.
      Specified by:
      setResponderId in interface RelyingPartyConfiguration
      Parameters:
      issuer - the issuer to set
    • setResponderIdLookupStrategy

      @Deprecated(since="5.0.0", forRemoval=true) public void setResponderIdLookupStrategy(@Nonnull Function<ProfileRequestContext,String> strategy)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set a lookup strategy for the issuer property.
      Parameters:
      strategy - lookup strategy
    • isDetailedErrors

      public boolean isDetailedErrors(@Nullable ProfileRequestContext profileRequestContext)
      Get whether detailed information about errors should be exposed.
      Specified by:
      isDetailedErrors in interface RelyingPartyConfiguration
      Parameters:
      profileRequestContext - current profile request context
      Returns:
      true iff it is acceptable to expose detailed error information
    • 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
    • getSecurityConfiguration

      @Nullable public SecurityConfiguration getSecurityConfiguration(@Nullable ProfileRequestContext profileRequestContext)
      Get the default SecurityConfiguration to use.
      Specified by:
      getSecurityConfiguration in interface RelyingPartyConfiguration
      Parameters:
      profileRequestContext - current profile request context
      Returns:
      default security configuration
    • setSecurityConfiguration

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

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

      @Nonnull @Unmodifiable @NotLive public Map<String,ProfileConfiguration> getProfileConfigurations(@Nullable ProfileRequestContext profileRequestContext)
      Get the unmodifiable set of profile configurations for this relying party.
      Specified by:
      getProfileConfigurations in interface RelyingPartyConfiguration
      Parameters:
      profileRequestContext - current profile request context
      Returns:
      unmodifiable set of profile configurations for this relying party, never null
    • getProfileConfiguration

      @Nullable public ProfileConfiguration getProfileConfiguration(@Nullable ProfileRequestContext profileRequestContext, @Nullable String profileId)
      Get the profile configuration, for the relying party, for the given profile. This is a convenience method and is equivalent to calling Map.get(Object) on the return of RelyingPartyConfiguration.getProfileConfigurations(ProfileRequestContext). This map contains no null entries, keys, or values.
      Specified by:
      getProfileConfiguration in interface RelyingPartyConfiguration
      Parameters:
      profileRequestContext - current profile request context
      profileId - the ID of the profile
      Returns:
      the configuration for the profile or null if the profile ID was null or empty or there is no configuration for the given profile
    • 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
      Since:
      4.0.0
    • setActivationCondition

      public void setActivationCondition(@Nonnull Predicate<ProfileRequestContext> condition)
      Set the condition under which the relying party configuration should be active.
      Parameters:
      condition - the activation condition
    • test

      public boolean test(@Nullable ProfileRequestContext input)
      Specified by:
      test in interface Predicate<ProfileRequestContext>