Class WebAuthState
- java.lang.Object
-
- com.inductiveautomation.ignition.gateway.auth.web.state.WebAuthState
-
public class WebAuthState extends java.lang.ObjectWraps state which will carry over from the initial federation request to the federation response. Includes a random state String, an expiration time for the state, and a map of state params.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWebAuthState.BuilderBuilder forWebAuthStateinstances
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static WebAuthState.Builderbuilder(java.lang.String app, java.lang.Boolean sessionless, java.net.URI errorRedirectUri)Factory method for creating newWebAuthState.Builderinstancesstatic WebAuthState.Builderbuilder(java.lang.String app, java.net.URI errorRedirectUri)Factory method for creating newWebAuthState.Builderinstanceslongexp()<T> java.util.Optional<T>get(java.lang.String key, java.lang.Class<T> clazz)Fetch a state paramjava.lang.Stringstate()
-
-
-
Method Detail
-
state
@Nonnull public java.lang.String state()
- Returns:
- the random state string
-
exp
public long exp()
- Returns:
- return the expiration time of this state in millis since the unix epoch
-
get
@Nonnull public <T> java.util.Optional<T> get(@Nonnull java.lang.String key, @Nonnull java.lang.Class<T> clazz)Fetch a state param- Parameters:
key- the desired state param keyclazz- the type of the state param value- Returns:
- an
Optionalcontaining the state param value associated with the given key or an empty Optional if no param exists for the given key - Throws:
java.lang.ClassCastException- if the param value cannot be cast to the type of the given class- See Also:
TypeUtilities.coerceGeneric(Object, Class)
-
builder
@Nonnull public static WebAuthState.Builder builder(@Nonnull java.lang.String app, @Nullable java.net.URI errorRedirectUri)
Factory method for creating newWebAuthState.Builderinstances- Parameters:
app- the name of the app the user is logging into / logging out oferrorRedirectUri- an optionalURIto redirect the user if there is an error handling the web auth response. a value of null means there is no error redirectURIset.- Returns:
- a new
WebAuthState.Builder
-
builder
@Nonnull public static WebAuthState.Builder builder(@Nonnull java.lang.String app, @Nullable java.lang.Boolean sessionless, @Nullable java.net.URI errorRedirectUri)
Factory method for creating newWebAuthState.Builderinstances- Parameters:
app- the name of the app the user is logging into / logging out ofsessionless- whether the IdP should use sessionless modeerrorRedirectUri- an optionalURIto redirect the user if there is an error handling the web auth response. a value of null means there is no error redirectURIset.- Returns:
- a new
WebAuthState.Builder
-
-