Class CookiePkcePersistence
java.lang.Object
io.micronaut.security.oauth2.endpoint.authorization.CookiePersistence
io.micronaut.security.oauth2.endpoint.authorization.pkce.persistence.cookie.CookiePkcePersistence
- All Implemented Interfaces:
PkcePersistence
Persists the Proof of Key Exchange (PKCE) code_verifier value in a cookie.
- Since:
- 3.9.0
- Author:
- Nemanja Mikic
-
Field Summary
Fields inherited from class io.micronaut.security.oauth2.endpoint.authorization.CookiePersistence
cookieConfiguration
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
persistPkce
(@NonNull io.micronaut.http.HttpRequest<?> request, @NonNull io.micronaut.http.MutableHttpResponse<?> response, @NonNull Pkce pkce) Persists the PKCE for later retrieval.retrieveCodeVerifier
(@NonNull io.micronaut.http.HttpRequest<?> request) Retrieve the code verifier and removes it from the session if present.Methods inherited from class io.micronaut.security.oauth2.endpoint.authorization.CookiePersistence
retrieveValue, save
-
Constructor Details
-
CookiePkcePersistence
- Parameters:
configuration
- The cookie configuration
-
-
Method Details
-
retrieveCodeVerifier
@NonNull public @NonNull Optional<String> retrieveCodeVerifier(@NonNull @NonNull io.micronaut.http.HttpRequest<?> request) Retrieve the code verifier and removes it from the session if present.- Specified by:
retrieveCodeVerifier
in interfacePkcePersistence
- Parameters:
request
- The request- Returns:
- The optional PKCE code verifier
-
persistPkce
public void persistPkce(@NonNull @NonNull io.micronaut.http.HttpRequest<?> request, @NonNull @NonNull io.micronaut.http.MutableHttpResponse<?> response, @NonNull @NonNull Pkce pkce) Description copied from interface:PkcePersistence
Persists the PKCE for later retrieval.- Specified by:
persistPkce
in interfacePkcePersistence
- Parameters:
request
- The login requestresponse
- The authorization redirect responsepkce
- The PKCE to persist
-