@Singleton public class CookieStatePersistence extends java.lang.Object implements StatePersistence
Constructor and Description |
---|
CookieStatePersistence(StateSerDes stateSerDes,
CookieStatePersistenceConfiguration configuration) |
Modifier and Type | Method and Description |
---|---|
void |
persistState(io.micronaut.http.HttpRequest<?> request,
io.micronaut.http.MutableHttpResponse response,
State state)
Persists the state for later retrieval to allow validation.
|
java.util.Optional<State> |
retrieveState(io.micronaut.http.HttpRequest<?> request)
Retrieves and removes the state from persistence.
|
public CookieStatePersistence(StateSerDes stateSerDes, CookieStatePersistenceConfiguration configuration)
stateSerDes
- The state serializer/deserializerconfiguration
- The cookie configurationpublic java.util.Optional<State> retrieveState(io.micronaut.http.HttpRequest<?> request)
StatePersistence
retrieveState
in interface StatePersistence
request
- The requestpublic void persistState(io.micronaut.http.HttpRequest<?> request, io.micronaut.http.MutableHttpResponse response, State state)
StatePersistence
persistState
in interface StatePersistence
request
- The login requestresponse
- The authorization redirect responsestate
- The state to persist