Class ExternalInterceptor
java.lang.Object
net.shibboleth.idp.profile.interceptor.ExternalInterceptor
- Direct Known Subclasses:
ExternalInterceptorImpl
Public interface supporting external interceptor flows outside the webflow engine.
- Since:
- 4.0.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
doFinish
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ProfileRequestContext profileRequestContext, ExternalInterceptorContext externalInterceptorContext) Complete a request to an external interceptor by seeking out the information stored in request attributes and transferring to the session's conversation state, and then transfer control back to the webflow.protected void
doStart
(javax.servlet.http.HttpServletRequest request, ProfileRequestContext profileRequestContext, ExternalInterceptorContext externalInterceptorContext) Initialize a request to an external interceptor by seeking out the information stored in the servlet session and exposing it as request attributes.static void
finishExternalInterceptor
(String key, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Complete a request to an external interceptor by seeking out the information stored in request attributes and transferring to the session's conversation state, and then transfer control back to the webflow.private static ExternalInterceptorContext
getExternalInterceptorContext
(ProfileRequestContext profileRequestContext) Utility method to access theExternalInterceptorContext
.static String
getExternalRedirect
(String baseLocation, String conversationValue) Computes the appropriate location to pass control to to invoke an external interceptor mechanism.static ProfileRequestContext
getProfileRequestContext
(String key, javax.servlet.http.HttpServletRequest request) Get theProfileRequestContext
associated with a request.static String
startExternalInterceptor
(javax.servlet.http.HttpServletRequest request) Initialize a request to an external interceptor by seeking out the information stored in the servlet session and exposing it as request attributes.
-
Field Details
-
SWF_KEY
Parameter supplied to locate the SWF object needed in the servlet context.- See Also:
-
CONVERSATION_KEY
Parameter supplied to identify the per-conversation parameter.- See Also:
-
EVENT_KEY
Request attribute to which an event ID may be bound.- See Also:
-
-
Constructor Details
-
ExternalInterceptor
public ExternalInterceptor()
-
-
Method Details
-
getExternalRedirect
@Nonnull @NotEmpty public static String getExternalRedirect(@Nonnull @NotEmpty String baseLocation, @Nonnull @NotEmpty String conversationValue) Computes the appropriate location to pass control to to invoke an external interceptor mechanism.The input location should be suitable for use in a Spring "externalRedirect" expression, and may contain a query string. The result will include any additional parameters needed to invoke the mechanism.
- Parameters:
baseLocation
- the base location to build off ofconversationValue
- the value to include as a conversation ID- Returns:
- the computed location
-
startExternalInterceptor
@Nonnull @NotEmpty public static String startExternalInterceptor(@Nonnull javax.servlet.http.HttpServletRequest request) throws ExternalInterceptorException Initialize a request to an external interceptor by seeking out the information stored in the servlet session and exposing it as request attributes.- Parameters:
request
- servlet request- Returns:
- a handle to subsequent use of
finishExternalInterceptor(java.lang.String, HttpServletRequest, HttpServletResponse)
- Throws:
ExternalInterceptorException
- if an error occurs
-
finishExternalInterceptor
public static void finishExternalInterceptor(@Nonnull @NotEmpty String key, @Nonnull javax.servlet.http.HttpServletRequest request, @Nonnull javax.servlet.http.HttpServletResponse response) throws ExternalInterceptorException, IOException Complete a request to an external interceptor by seeking out the information stored in request attributes and transferring to the session's conversation state, and then transfer control back to the webflow.- Parameters:
key
- the value returned bystartExternalInterceptor(HttpServletRequest)
request
- servlet requestresponse
- servlet response- Throws:
ExternalInterceptorException
- if an error occursIOException
- if the redirect cannot be issued
-
getProfileRequestContext
@Nonnull public static ProfileRequestContext getProfileRequestContext(@Nonnull @NotEmpty String key, @Nonnull javax.servlet.http.HttpServletRequest request) throws ExternalInterceptorException Get theProfileRequestContext
associated with a request.- Parameters:
key
- the value returned bystartExternalInterceptor(HttpServletRequest)
request
- servlet request- Returns:
- the profile request context
- Throws:
ExternalInterceptorException
- if an error occurs
-
getExternalInterceptorContext
@Nonnull private static ExternalInterceptorContext getExternalInterceptorContext(@Nonnull ProfileRequestContext profileRequestContext) throws ExternalInterceptorException Utility method to access theExternalInterceptorContext
.- Parameters:
profileRequestContext
- profile request context- Returns:
- the
ExternalInterceptorContext
to operate on - Throws:
ExternalInterceptorException
- if the context is missing
-
doStart
protected void doStart(@Nonnull javax.servlet.http.HttpServletRequest request, @Nonnull ProfileRequestContext profileRequestContext, @Nonnull ExternalInterceptorContext externalInterceptorContext) throws ExternalInterceptorException Initialize a request to an external interceptor by seeking out the information stored in the servlet session and exposing it as request attributes.- Parameters:
request
- servlet requestprofileRequestContext
- profile request contextexternalInterceptorContext
- external interceptor context- Throws:
ExternalInterceptorException
- if an error occurs
-
doFinish
protected abstract void doFinish(@Nonnull javax.servlet.http.HttpServletRequest request, @Nonnull javax.servlet.http.HttpServletResponse response, @Nonnull ProfileRequestContext profileRequestContext, @Nonnull ExternalInterceptorContext externalInterceptorContext) throws ExternalInterceptorException, IOException Complete a request to an external interceptor by seeking out the information stored in request attributes and transferring to the session's conversation state, and then transfer control back to the webflow.- Parameters:
request
- servlet requestresponse
- servlet responseprofileRequestContext
- profile request contextexternalInterceptorContext
- external interceptor context- Throws:
ExternalInterceptorException
- if an error occursIOException
- if the redirect cannot be issued
-