java.lang.Object
io.micronaut.security.oauth2.endpoint.authorization.CookiePersistence
io.micronaut.security.oauth2.endpoint.authorization.state.persistence.cookie.CookieStatePersistence
All Implemented Interfaces:
StatePersistence

@Singleton public class CookieStatePersistence extends CookiePersistence implements StatePersistence
Persists the state value in a cookie.
Since:
1.2.0
Author:
James Kleeh
  • Constructor Details

    • CookieStatePersistence

      public CookieStatePersistence(StateSerDes stateSerDes, CookieStatePersistenceConfiguration configuration)
      Parameters:
      stateSerDes - The state serializer/deserializer
      configuration - The cookie configuration
  • Method Details

    • retrieveState

      public Optional<State> retrieveState(io.micronaut.http.HttpRequest<?> request)
      Description copied from interface: StatePersistence
      Retrieves and removes the state from persistence.
      Specified by:
      retrieveState in interface StatePersistence
      Parameters:
      request - The request
      Returns:
      The optional state
    • persistState

      public void persistState(io.micronaut.http.HttpRequest<?> request, io.micronaut.http.MutableHttpResponse response, State state)
      Description copied from interface: StatePersistence
      Persists the state for later retrieval to allow validation.
      Specified by:
      persistState in interface StatePersistence
      Parameters:
      request - The login request
      response - The authorization redirect response
      state - The state to persist