Class PreferredPrincipalContext

java.lang.Object
org.opensaml.messaging.context.BaseContext
net.shibboleth.idp.authn.context.PreferredPrincipalContext
All Implemented Interfaces:
Iterable<BaseContext>

public final class PreferredPrincipalContext
extends BaseContext
A context that holds information about an authentication request's preference for a specific custom Principal.

Authentication protocols with features for preferring specific forms of authentication with optional semantics will populate this context type with an expression of those preferences in the form of an ordered list of custom Principal objects.

Since:
3.4.0
Parent:
AuthenticationContext
Added:
Before the authentication process begins
  • Field Details

  • Constructor Details

    • PreferredPrincipalContext

      public PreferredPrincipalContext()
      Constructor.
  • Method Details

    • getPreferredPrincipals

      @Nonnull @NonnullElements @Unmodifiable @NotLive public List<Principal> getPreferredPrincipals()
      Get an immutable list of principals reflecting the request preferences.
      Returns:
      immutable list of principals
    • setPreferredPrincipals

      @Nonnull public PreferredPrincipalContext setPreferredPrincipals​(@Nonnull @NonnullElements List<Principal> principals)
      Set list of principals reflecting the request preferences.
      Parameters:
      principals - list of principals
      Returns:
      this context
    • isAcceptable

      public boolean isAcceptable​(@Nonnull PrincipalSupportingComponent component)
      Helper method that evaluates a PrincipalSupportingComponent against this context to determine if the input is compatible with it.
      Parameters:
      component - component to evaluate
      Returns:
      true iff the input is compatible with the requested authentication preferences
    • isAcceptable

      public boolean isAcceptable​(@Nonnull @NonnullElements Collection<Principal> principals)
      Helper method that evaluates Principal objects against this context to determine if the input is compatible with it.
      Parameters:
      principals - principal(s) to evaluate
      Returns:
      true iff the input is compatible with the requested authentication preferences
    • isAcceptable

      public <T extends Principal> boolean isAcceptable​(@Nonnull T principal)
      Helper method that evaluates a Principal object against this context to determine if the input is compatible with it.
      Type Parameters:
      T - type of principal
      Parameters:
      principal - principal to evaluate
      Returns:
      true iff the input is compatible with the requested authentication preferences