Class WebAuthRequestCollection
- java.lang.Object
- 
- com.inductiveautomation.ignition.common.lifecycle.AbstractLifecycle
- 
- com.inductiveautomation.ignition.gateway.auth.web.WebAuthRequestCollection
 
 
- 
- All Implemented Interfaces:
- java.util.EventListener,- javax.servlet.http.HttpSessionBindingListener
 
 public class WebAuthRequestCollection extends AbstractLifecycle implements javax.servlet.http.HttpSessionBindingListener A collection of web auth requests represented as relay state -> WebAuthRequestCollection.WebAuthCallbackpairs.Each HttpSessionmay have at most one collection.The internal collection supports high-concurrency and is thread-safe. When a collection is bound to an HttpSession, it is started up, which schedules the first reaper.A reaper is scheduled every 2 minutes to clear out any expired web auth requests. When a collection is unbound from an HttpSession, it is shut down, which clears the internal collection .
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static interfaceWebAuthRequestCollection.BaseWebAuthResponseHandlerBaseWebAuthRequestCollection.WebAuthResponseHandlerinterface which provides some default method implementations common to many types of handlersclassWebAuthRequestCollection.LoginRequestBuilderProvides a fluent-API (builder-style) pattern for creating new login requests encoded as aURIstatic interfaceWebAuthRequestCollection.LoginResponseHandlerWebAuthRequestCollection.BaseWebAuthResponseHandlerwhich handles login responsesclassWebAuthRequestCollection.LogoutRequestBuilderProvides a fluent-API (builder-style) pattern for creating new logout requests encoded as aURIstatic interfaceWebAuthRequestCollection.LogoutResponseHandlerWebAuthRequestCollection.BaseWebAuthResponseHandlerwhich handles logout responsesstatic classWebAuthRequestCollection.WebAuthCallbackWraps a web auth request's creation timestamp, state to be carried from request to response, and a web auth response handler for handling the web auth response associated with the request.classWebAuthRequestCollection.WebAuthRequestBuilder<T extends WebAuthRequestCollection.WebAuthRequestBuilder<T>>Provides a fluent-API (builder-style) pattern for creating new web auth requests encoded as aURIstatic interfaceWebAuthRequestCollection.WebAuthResponseHandlerHandler for web auth responsesstatic interfaceWebAuthRequestCollection.WebAuthTimeoutContextProvides context forWebAuthRequestCollection.WebAuthResponseHandlers to handle timeouts
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description WebAuthRequestCollection.LoginRequestBuildercreateLoginRequest()WebAuthRequestCollection.LogoutRequestBuildercreateLogoutRequest()java.util.Optional<WebAuthRequestCollection.WebAuthCallback>get(java.lang.String state)Fetch theWebAuthRequestCollection.WebAuthCallbackassociated with the given relay state valuestatic WebAuthRequestCollectiongetOrCreate(RequestContext req)static WebAuthRequestCollectiongetOrCreate(GatewayContext gatewayContext, javax.servlet.http.HttpServletRequest httpServletRequest)static WebAuthRequestCollectiongetOrCreate(GatewayContext gatewayContext, javax.servlet.http.HttpSession httpSession)Gets theWebAuthRequestCollectionassociated with the givenHttpSession.protected voidonShutdown()protected voidonStartup()voidregisterHandler(java.lang.String state, java.lang.String app, WebAuthRequestCollection.WebAuthResponseHandler handler)Allows you to manually register a state key to a given handler.java.util.Optional<WebAuthRequestCollection.WebAuthCallback>remove(java.lang.String state)Remove theWebAuthRequestCollection.WebAuthCallbackassociated with the given relay state valuevoidvalueBound(javax.servlet.http.HttpSessionBindingEvent event)voidvalueUnbound(javax.servlet.http.HttpSessionBindingEvent event)- 
Methods inherited from class com.inductiveautomation.ignition.common.lifecycle.AbstractLifecycleisRunning, shutdown, startup
 
- 
 
- 
- 
- 
Method Detail- 
getOrCreate@Nonnull public static WebAuthRequestCollection getOrCreate(@Nonnull GatewayContext gatewayContext, @Nonnull javax.servlet.http.HttpSession httpSession) Gets theWebAuthRequestCollectionassociated with the givenHttpSession. If aWebAuthRequestCollectiondoes not exist on the session, a new instance is created, set on the session, and returned.- Parameters:
- gatewayContext- the currently executing- GatewayContext
- httpSession- the- HttpSessionholding the- WebAuthRequestCollection
- Returns:
- the WebAuthRequestCollectionassociated with the givenHttpSession
 
 - 
getOrCreate@Nonnull public static WebAuthRequestCollection getOrCreate(@Nonnull GatewayContext gatewayContext, @Nonnull javax.servlet.http.HttpServletRequest httpServletRequest) Gets theWebAuthRequestCollectionassociated with theHttpSessionon the givenHttpServletRequest. If aWebAuthRequestCollectiondoes not exist on the session, a new instance is created, set on the session, and returned.- Parameters:
- gatewayContext- the currently executing- GatewayContext
- httpServletRequest- the- HttpServletRequestwhich contains the- HttpSessionholding the- WebAuthRequestCollection
- Returns:
- the WebAuthRequestCollectionassociated with the givenHttpServletRequest'sHttpSession
- See Also:
- getOrCreate(GatewayContext, HttpSession)
 
 - 
getOrCreate@Nonnull public static WebAuthRequestCollection getOrCreate(@Nonnull RequestContext req) Gets theWebAuthRequestCollectionassociated with theHttpSessionon the givenRequestContext. If aWebAuthRequestCollectiondoes not exist on the session, a new instance is created, set on the session, and returned.- Parameters:
- req- the- RequestContextwhich contains the- HttpSessionholding the- WebAuthRequestCollection
- Returns:
- the WebAuthRequestCollectionassociated with the givenRequestContext'sHttpSession
- See Also:
- getOrCreate(GatewayContext, HttpServletRequest)
 
 - 
get@Nonnull public java.util.Optional<WebAuthRequestCollection.WebAuthCallback> get(@Nonnull java.lang.String state) Fetch theWebAuthRequestCollection.WebAuthCallbackassociated with the given relay state value- Parameters:
- state- the relay state value
- Returns:
- an Optionalcontaining theWebAuthRequestCollection.WebAuthCallbackassociated with the given relay state or an emptyOptionalif there is noWebAuthRequestCollection.WebAuthCallbackassociated with the given relay state
 
 - 
remove@Nonnull public java.util.Optional<WebAuthRequestCollection.WebAuthCallback> remove(@Nonnull java.lang.String state) Remove theWebAuthRequestCollection.WebAuthCallbackassociated with the given relay state value- Parameters:
- state- the relay state value
- Returns:
- an Optionalcontaining theWebAuthRequestCollection.WebAuthCallbackassociated with the given relay state or an emptyOptionalif there is noWebAuthRequestCollection.WebAuthCallbackassociated with the given relay state
 
 - 
valueBoundpublic void valueBound(javax.servlet.http.HttpSessionBindingEvent event) - Specified by:
- valueBoundin interface- javax.servlet.http.HttpSessionBindingListener
 
 - 
valueUnboundpublic void valueUnbound(javax.servlet.http.HttpSessionBindingEvent event) - Specified by:
- valueUnboundin interface- javax.servlet.http.HttpSessionBindingListener
 
 - 
onStartupprotected void onStartup() - Specified by:
- onStartupin class- AbstractLifecycle
 
 - 
onShutdownprotected void onShutdown() - Specified by:
- onShutdownin class- AbstractLifecycle
 
 - 
registerHandlerpublic void registerHandler(java.lang.String state, java.lang.String app, WebAuthRequestCollection.WebAuthResponseHandler handler)Allows you to manually register a state key to a given handler.- Parameters:
- state- the state key used to retrieve- WebAuthRequestCollection.WebAuthCallbackinstead of using the state key generated from the- WebAuthState
- app- the app's name
- handler- the- WebAuthRequestCollection.WebAuthResponseHandlerto handle the web auth response for this request
 
 - 
createLoginRequest@Nonnull public WebAuthRequestCollection.LoginRequestBuilder createLoginRequest() - Returns:
- a new WebAuthRequestCollection.LoginRequestBuilderinstance
 
 - 
createLogoutRequest@Nonnull public WebAuthRequestCollection.LogoutRequestBuilder createLogoutRequest() - Returns:
- a new WebAuthRequestCollection.LogoutRequestBuilderinstance
 
 
- 
 
-