public class FinalizeAuthentication extends AbstractAuthenticationAction
SubjectContext
child of the ProfileRequestContext.
The action also cross-checks RequestedPrincipalContext.getMatchingPrincipal(), if set,
against the AuthenticationResult to ensure that the result produced actually satisfies the
request. This is redundant when reusing active results, but is necessary to prevent a flow from running
that can return different results and having it produce a result that doesn't actually satisfy the
request. Such a flow would be buggy, but this guards against a mistake from leaving the subsystem.
If no matching Principal is established, or if the match is no longer valid, the request is
evaluated in conjunction with the AuthenticationResult to establish a Principal that
does satisfy the request and it is recorded via
RequestedPrincipalContext.setMatchingPrincipal(Principal).
The context is populated based on the presence of a canonical principal name in either
a SubjectCanonicalizationContext or SessionContext, and also includes
the completed AuthenticationResult and any other active results found in the
AuthenticationContext.
Any SubjectCanonicalizationContext found will be removed.
If a SubjectContext already exists, then this action will validate that
the same principal name is represented by it, and signal a mismatch otherwise. This
is used in protocols that indicate normatively what the authenticated identity is
required to be.
EventIds.PROCEED_EVENT_ID, IdPEventIds.INVALID_SUBJECT_CTX, AuthnEventIds.REQUEST_UNSUPPORTEDProfileRequestContext.getSubcontext(AuthenticationContext.class) != null
ProfileRequestContext.getSubcontext(SubjectCanonicalizationContext.class) == null
| Modifier and Type | Class and Description |
|---|---|
private class |
FinalizeAuthentication.WeightedComparator
A
Comparator that compares the mapped weights of the two operands, using a weight of zero
for any unmapped values. |
| Modifier and Type | Field and Description |
|---|---|
private String |
canonicalPrincipalName
The principal name extracted from the context tree.
|
private org.slf4j.Logger |
log
Class logger.
|
private Map<Principal,Integer> |
weightMap
A map supplying weighted preference to particular Principals.
|
| Constructor and Description |
|---|
FinalizeAuthentication()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
doExecute(ProfileRequestContext profileRequestContext,
AuthenticationContext authenticationContext) |
protected boolean |
doPreExecute(ProfileRequestContext profileRequestContext,
AuthenticationContext authenticationContext) |
protected Principal |
findMatchingPrincipal(AuthenticationContext authenticationContext,
RequestedPrincipalContext requestedPrincipalCtx)
Evaluate request criteria and the
AuthenticationResult to locate a Principal in the
result that satisfies the request criteria. |
void |
setWeightMap(Map<Principal,Integer> map)
Set the map of Principals to weight values to impose a sort order on any matching Principals
found in the authentication result.
|
doExecute, doPreExecute, setLookupStrategydoExecute, execute, getMessage, getMessage, getMessage, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategygetActivationCondition, setActivationConditiondoPostExecute, doPostExecute, execute, getHttpServletRequest, getHttpServletResponse, getLogPrefix, setHttpServletRequest, setHttpServletResponsedestroy, doDestroy, doInitialize, initialize, isDestroyed, isInitializedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitialize, isInitialized@Nonnull private final org.slf4j.Logger log
@Nonnull @NonnullElements private Map<Principal,Integer> weightMap
public void setWeightMap(@Nullable@NonnullElements Map<Principal,Integer> map)
map - map to setprotected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext)
doPreExecute in class AbstractAuthenticationActionprotected void doExecute(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext)
doExecute in class AbstractAuthenticationAction@Nullable protected Principal findMatchingPrincipal(@Nonnull AuthenticationContext authenticationContext, @Nonnull RequestedPrincipalContext requestedPrincipalCtx)
AuthenticationResult to locate a Principal in the
result that satisfies the request criteria.
If a weighting map is supplied, the Principal returned is the one that both satisfies
the request and is highest weighted.
authenticationContext - authentication contextrequestedPrincipalCtx - request criteriaCopyright © 1999–2018 Shibboleth Consortium. All rights reserved.