public class ExtractSubjectFromRequest extends AbstractProfileAction
SubjectCanonicalizationContext to process it into a principal identity.
If the inbound message does not supply a NameIdentifier or NameID to
process, then nothing is done, and the local event ID NO_SUBJECT is signaled.
A policy predicate may also be executed to control the conditions under which a subject
name may be used by a requester, possibly resulting in a AuthnEventIds.INVALID_SUBJECT
event.
Otherwise, a custom Principal of the appropriate type is wrapped around the
identifier object and a Java Subject is prepared for canonicalization.
EventIds.PROCEED_EVENT_ID, AuthnEventIds.INVALID_SUBJECT, NO_SUBJECT| Modifier and Type | Class and Description |
|---|---|
static class |
ExtractSubjectFromRequest.SubjectNameLookupFunction
Lookup function that returns the
NameIdentifier or NameID from the request in the inbound
message context. |
| Modifier and Type | Field and Description |
|---|---|
private org.slf4j.Logger |
log
Class logger.
|
private org.opensaml.saml.common.SAMLObject |
nameIdentifier
SAML 1 or 2 identifier object to wrap for c14n.
|
private Predicate<org.opensaml.profile.context.ProfileRequestContext> |
nameIDPolicyPredicate
Predicate to validate use of
NameID or NameIdentifier in subject. |
static String |
NO_SUBJECT
Local event signaling that canonicalization is unnecessary.
|
private Function<org.opensaml.profile.context.ProfileRequestContext,String> |
requesterLookupStrategy
Function used to obtain the requester ID.
|
private Function<org.opensaml.profile.context.ProfileRequestContext,String> |
responderLookupStrategy
Function used to obtain the responder ID.
|
| Constructor and Description |
|---|
ExtractSubjectFromRequest()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
doExecute(org.opensaml.profile.context.ProfileRequestContext profileRequestContext) |
protected boolean |
doPreExecute(org.opensaml.profile.context.ProfileRequestContext profileRequestContext) |
void |
setNameIDPolicyPredicate(Predicate<org.opensaml.profile.context.ProfileRequestContext> predicate)
Set a predicate used to validate use of the
NameID or NameIdentifier in the subject. |
void |
setRequesterLookupStrategy(Function<org.opensaml.profile.context.ProfileRequestContext,String> strategy)
Set the strategy used to locate the requester ID for canonicalization.
|
void |
setResponderLookupStrategy(Function<org.opensaml.profile.context.ProfileRequestContext,String> strategy)
Set the strategy used to locate the responder ID for canonicalization.
|
doExecute, 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 @NotEmpty public static final String NO_SUBJECT
@Nonnull private final org.slf4j.Logger log
@Nullable private Predicate<org.opensaml.profile.context.ProfileRequestContext> nameIDPolicyPredicate
NameID or NameIdentifier in subject.@Nullable private Function<org.opensaml.profile.context.ProfileRequestContext,String> requesterLookupStrategy
@Nullable private Function<org.opensaml.profile.context.ProfileRequestContext,String> responderLookupStrategy
@Nullable private org.opensaml.saml.common.SAMLObject nameIdentifier
public ExtractSubjectFromRequest()
throws ComponentInitializationException
ComponentInitializationException - if unable to initialize default objectspublic void setRequesterLookupStrategy(@Nullable Function<org.opensaml.profile.context.ProfileRequestContext,String> strategy)
strategy - lookup strategypublic void setResponderLookupStrategy(@Nullable Function<org.opensaml.profile.context.ProfileRequestContext,String> strategy)
strategy - lookup strategypublic void setNameIDPolicyPredicate(@Nullable Predicate<org.opensaml.profile.context.ProfileRequestContext> predicate)
NameID or NameIdentifier in the subject.predicate - predicate to useprotected boolean doPreExecute(@Nonnull org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
doPreExecute in class org.opensaml.profile.action.AbstractConditionalProfileActionprotected void doExecute(@Nonnull org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
doExecute in class org.opensaml.profile.action.AbstractProfileActionCopyright © 1999–2017 Shibboleth Consortium. All rights reserved.