Class DefaultStateController

java.lang.Object
com.jagrosh.jdautilities.oauth2.state.DefaultStateController
All Implemented Interfaces:
StateController

public class DefaultStateController extends Object implements StateController
The default StateController implementation.
Author:
John Grosh ([email protected])
  • Constructor Details

    • DefaultStateController

      public DefaultStateController()
  • Method Details

    • generateNewState

      public String generateNewState(String redirectUri)
      Description copied from interface: StateController
      Generates a new state string using the provided redirect URI.
      Specified by:
      generateNewState in interface StateController
      Parameters:
      redirectUri - The redirect URI that will be used with this state.
      Returns:
      The state string.
    • consumeState

      public String consumeState(String state)
      Description copied from interface: StateController
      Consumes a state to get the corresponding redirect URI.

      Once this method is called for a specific state, it should return null for all future calls of that same state.

      Specified by:
      consumeState in interface StateController
      Parameters:
      state - The state.
      Returns:
      The redirect URI, or null if the state does not exist.