Class ExtractSubjectFromRequest
java.lang.Object
net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
org.opensaml.profile.action.AbstractProfileAction
org.opensaml.profile.action.AbstractConditionalProfileAction
net.shibboleth.idp.profile.AbstractProfileAction
net.shibboleth.idp.saml.profile.impl.ExtractSubjectFromRequest
- All Implemented Interfaces:
Component
,DestructableComponent
,InitializableComponent
,ProfileAction
,Aware
,MessageSource
,MessageSourceAware
,Action
Action that extracts a SAML Subject from an inbound message, and prepares a
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.
- Event:
EventIds.PROCEED_EVENT_ID
,AuthnEventIds.INVALID_SUBJECT
,NO_SUBJECT
- Postcondition:
- If "proceed" signaled, then ProfileRequestContext.getSubcontext(SubjectCanonicalizationContext.class) != null
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Lookup function that returns theNameIdentifier
orNameID
from the request in the inbound message context. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.slf4j.Logger
Class logger.private SAMLObject
SAML 1 or 2 identifier object to wrap for c14n.private Predicate<ProfileRequestContext>
Predicate to validate use ofNameID
orNameIdentifier
in subject.static final String
Local event signaling that canonicalization is unnecessary.private Function<ProfileRequestContext,
String> Function used to obtain the requester ID.private Function<ProfileRequestContext,
String> Function used to obtain the responder ID. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doExecute
(ProfileRequestContext profileRequestContext) protected boolean
doPreExecute
(ProfileRequestContext profileRequestContext) void
setNameIDPolicyPredicate
(Predicate<ProfileRequestContext> predicate) Set a predicate used to validate use of theNameID
orNameIdentifier
in the subject.void
Set the strategy used to locate the requester ID for canonicalization.void
Set the strategy used to locate the responder ID for canonicalization.Methods inherited from class net.shibboleth.idp.profile.AbstractProfileAction
doExecute, execute, getBean, getBean, getMessage, getMessage, getMessage, getParameter, getParameter, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategy
Methods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction
getActivationCondition, setActivationCondition
Methods inherited from class org.opensaml.profile.action.AbstractProfileAction
doPostExecute, doPostExecute, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, setHttpServletRequest, setHttpServletRequestSupplier, setHttpServletResponse, setHttpServletResponseSupplier
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, doInitialize, initialize, isDestroyed, isInitialized
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
NO_SUBJECT
Local event signaling that canonicalization is unnecessary.- See Also:
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
nameIDPolicyPredicate
Predicate to validate use ofNameID
orNameIdentifier
in subject. -
requesterLookupStrategy
Function used to obtain the requester ID. -
responderLookupStrategy
Function used to obtain the responder ID. -
nameIdentifier
SAML 1 or 2 identifier object to wrap for c14n.
-
-
Constructor Details
-
ExtractSubjectFromRequest
Constructor.- Throws:
ComponentInitializationException
- if unable to initialize default objects
-
-
Method Details
-
setRequesterLookupStrategy
Set the strategy used to locate the requester ID for canonicalization.- Parameters:
strategy
- lookup strategy
-
setResponderLookupStrategy
Set the strategy used to locate the responder ID for canonicalization.- Parameters:
strategy
- lookup strategy
-
setNameIDPolicyPredicate
Set a predicate used to validate use of theNameID
orNameIdentifier
in the subject.- Parameters:
predicate
- predicate to use
-
doPreExecute
- Overrides:
doPreExecute
in classAbstractConditionalProfileAction
-
doExecute
- Overrides:
doExecute
in classAbstractProfileAction
-