Class DefaultStateFactory
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 Summary
ConstructorDescriptionDefaultStateFactory
(StateSerDes stateSerDes, StatePersistence statePersistence) -
Method Summary
Modifier and TypeMethodDescription@Nullable String
buildState
(io.micronaut.http.HttpRequest<?> request, io.micronaut.http.MutableHttpResponse response, @Nullable AuthorizationRequest authorizationRequest) protected MutableState
-
Constructor Details
-
DefaultStateFactory
- Parameters:
stateSerDes
- To serialize the statestatePersistence
- 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 interfaceStateFactory
- Parameters:
request
- The original request prior redirectresponse
- The authorization redirect responseauthorizationRequest
- theAuthorizationRequest
- Returns:
- A state parameter. An opaque value used to maintain state between the request and the callback.
-
createInitialState
- Returns:
- The mutable state to further modify
-