java.lang.Object
io.micronaut.security.oauth2.endpoint.authorization.state.DefaultStateFactory
All Implemented Interfaces:
StateFactory

@Singleton @Requires(beans=StatePersistence.class) public class DefaultStateFactory extends Object implements StateFactory
A default state provider that stores the original request URI to redirect back to after authentication.
Since:
1.2.0
Author:
James Kleeh
  • Constructor Details

    • DefaultStateFactory

      public DefaultStateFactory(StateSerDes stateSerDes, StatePersistence statePersistence)
      Parameters:
      stateSerDes - To serialize the state
      statePersistence - A state persistence
  • Method Details

    • buildState

      @Nullable public @Nullable String buildState(io.micronaut.http.HttpRequest<?> request, io.micronaut.http.MutableHttpResponse response, @Nullable @Nullable AuthorizationRequest authorizationRequest)
      Specified by:
      buildState in interface StateFactory
      Parameters:
      request - The original request prior redirect
      response - The authorization redirect response
      authorizationRequest - the AuthorizationRequest
      Returns:
      A state parameter. An opaque value used to maintain state between the request and the callback.
    • createInitialState

      protected MutableState createInitialState()
      Returns:
      The mutable state to further modify