Interface StateController

All Known Implementing Classes:
DefaultStateController

public interface StateController
Implementable state controller, used for registering states and generating redirect URIs using them.

Naturally, states should be unique, and attempting to generate a redirect using a previously used state should return null instead of a new redirect URI.

Author:
John Grosh ([email protected])
  • Method Summary

    Modifier and Type
    Method
    Description
    Consumes a state to get the corresponding redirect URI.
    generateNewState(String redirectUri)
    Generates a new state string using the provided redirect URI.
  • Method Details

    • generateNewState

      String generateNewState(String redirectUri)
      Generates a new state string using the provided redirect URI.
      Parameters:
      redirectUri - The redirect URI that will be used with this state.
      Returns:
      The state string.
    • consumeState

      String consumeState(String state)
      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.

      Parameters:
      state - The state.
      Returns:
      The redirect URI, or null if the state does not exist.