Package net.shibboleth.idp.authn.context
Class PreferredPrincipalContext
java.lang.Object
org.opensaml.messaging.context.BaseContext
net.shibboleth.idp.authn.context.PreferredPrincipalContext
- All Implemented Interfaces:
Iterable<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
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opensaml.messaging.context.BaseContext
BaseContext.ContextSetNoRemoveIteratorDecorator, BaseContext.DeprecatedContextClassNameLookAside -
Field Summary
FieldsModifier and TypeFieldDescriptionThe principals reflecting the preference. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet an immutable list of principals reflecting the request preferences.booleanisAcceptable(Collection<Principal> principals) Helper method that evaluatesPrincipalobjects against this context to determine if the input is compatible with it.booleanisAcceptable(PrincipalSupportingComponent component) Helper method that evaluates aPrincipalSupportingComponentagainst this context to determine if the input is compatible with it.<T extends Principal>
booleanisAcceptable(T principal) Helper method that evaluates aPrincipalobject against this context to determine if the input is compatible with it.setPreferredPrincipals(List<Principal> principals) Set list of principals reflecting the request preferences.Methods inherited from class org.opensaml.messaging.context.BaseContext
addSubcontext, addSubcontext, clearSubcontexts, containsSubcontext, createSubcontext, ensureSubcontext, ensureSubcontext, getParent, getSubcontext, getSubcontext, getSubcontext, getSubcontext, iterator, removeFromParent, removeSubcontext, removeSubcontext, setParentMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
preferredPrincipals
The principals reflecting the preference.
-
-
Constructor Details
-
PreferredPrincipalContext
public PreferredPrincipalContext()Constructor.
-
-
Method Details
-
getPreferredPrincipals
Get an immutable list of principals reflecting the request preferences.- Returns:
- immutable list of principals
-
setPreferredPrincipals
@Nonnull public PreferredPrincipalContext setPreferredPrincipals(@Nonnull List<Principal> principals) Set list of principals reflecting the request preferences.- Parameters:
principals- list of principals- Returns:
- this context
-
isAcceptable
Helper method that evaluates aPrincipalSupportingComponentagainst 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
Helper method that evaluatesPrincipalobjects 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
Helper method that evaluates aPrincipalobject 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
-