Class CookieStatePersistence
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
-
Field Summary
Fields inherited from class io.micronaut.security.oauth2.endpoint.authorization.CookiePersistence
cookieConfiguration
-
Constructor Summary
ConstructorDescriptionCookieStatePersistence
(StateSerDes stateSerDes, CookieStatePersistenceConfiguration configuration) -
Method Summary
Modifier and TypeMethodDescriptionvoid
persistState
(io.micronaut.http.HttpRequest<?> request, io.micronaut.http.MutableHttpResponse response, State state) Persists the state for later retrieval to allow validation.retrieveState
(io.micronaut.http.HttpRequest<?> request) Retrieves and removes the state from persistence.Methods inherited from class io.micronaut.security.oauth2.endpoint.authorization.CookiePersistence
retrieveValue, save
-
Constructor Details
-
CookieStatePersistence
public CookieStatePersistence(StateSerDes stateSerDes, CookieStatePersistenceConfiguration configuration) - Parameters:
stateSerDes
- The state serializer/deserializerconfiguration
- The cookie configuration
-
-
Method Details
-
retrieveState
Description copied from interface:StatePersistence
Retrieves and removes the state from persistence.- Specified by:
retrieveState
in interfaceStatePersistence
- 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 interfaceStatePersistence
- Parameters:
request
- The login requestresponse
- The authorization redirect responsestate
- The state to persist
-