Class ExternalInterceptor
- java.lang.Object
-
- net.shibboleth.idp.profile.interceptor.ExternalInterceptor
-
public abstract class ExternalInterceptor extends Object
Public interface supporting external interceptor flows outside the webflow engine.- Since:
- 4.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static StringCONVERSATION_KEYParameter supplied to identify the per-conversation parameter.static StringEVENT_KEYRequest attribute to which an event ID may be bound.static StringSWF_KEYParameter supplied to locate the SWF object needed in the servlet context.
-
Constructor Summary
Constructors Constructor Description ExternalInterceptor()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voiddoFinish(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.opensaml.profile.context.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 voiddoStart(javax.servlet.http.HttpServletRequest request, org.opensaml.profile.context.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 voidfinishExternalInterceptor(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 ExternalInterceptorContextgetExternalInterceptorContext(org.opensaml.profile.context.ProfileRequestContext profileRequestContext)Utility method to access theExternalInterceptorContext.static StringgetExternalRedirect(String baseLocation, String conversationValue)Computes the appropriate location to pass control to to invoke an external interceptor mechanism.static org.opensaml.profile.context.ProfileRequestContextgetProfileRequestContext(String key, javax.servlet.http.HttpServletRequest request)Get theProfileRequestContextassociated with a request.static StringstartExternalInterceptor(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 Detail
-
SWF_KEY
@Nonnull @NotEmpty public static final String SWF_KEY
Parameter supplied to locate the SWF object needed in the servlet context.- See Also:
- Constant Field Values
-
CONVERSATION_KEY
@Nonnull @NotEmpty public static final String CONVERSATION_KEY
Parameter supplied to identify the per-conversation parameter.- See Also:
- Constant Field Values
-
EVENT_KEY
@Nonnull @NotEmpty public static final String EVENT_KEY
Request attribute to which an event ID may be bound.- See Also:
- Constant Field Values
-
-
Method Detail
-
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, IOExceptionComplete 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 org.opensaml.profile.context.ProfileRequestContext getProfileRequestContext(@Nonnull @NotEmpty String key, @Nonnull javax.servlet.http.HttpServletRequest request) throws ExternalInterceptorExceptionGet theProfileRequestContextassociated 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 org.opensaml.profile.context.ProfileRequestContext profileRequestContext) throws ExternalInterceptorException
Utility method to access theExternalInterceptorContext.- Parameters:
profileRequestContext- profile request context- Returns:
- the
ExternalInterceptorContextto operate on - Throws:
ExternalInterceptorException- if the context is missing
-
doStart
protected void doStart(@Nonnull javax.servlet.http.HttpServletRequest request, @Nonnull org.opensaml.profile.context.ProfileRequestContext profileRequestContext, @Nonnull ExternalInterceptorContext externalInterceptorContext) throws ExternalInterceptorExceptionInitialize 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 org.opensaml.profile.context.ProfileRequestContext profileRequestContext, @Nonnull ExternalInterceptorContext externalInterceptorContext) throws ExternalInterceptorException, IOExceptionComplete 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
-
-