Class WebAuthState


  • public class WebAuthState
    extends java.lang.Object
    Wraps 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.
    • 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 key
        clazz - the type of the state param value
        Returns:
        an Optional containing 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​(@Nullable
                                                   java.net.URI errorRedirectUri)
        Factory method for creating new WebAuthState.Builder instances
        Parameters:
        errorRedirectUri - an optional URI to redirect the user if there is an error handling the web auth response. a value of null means there is no error redirect URI set.
        Returns:
        a new WebAuthState.Builder