Class SessionPkcePersistence
java.lang.Object
io.micronaut.security.oauth2.endpoint.authorization.pkce.persistence.session.SessionPkcePersistence
- All Implemented Interfaces:
PkcePersistence
@Requires(beans=io.micronaut.session.SessionStore.class)
@Singleton
public class SessionPkcePersistence
extends Object
implements PkcePersistence
Persists the Proof of Key Exchange (PKCE) code_verifier in the session.
- Since:
- 3.9.0
- Author:
- Nemanja Mikic
-
Constructor Summary
ConstructorDescriptionSessionPkcePersistence
(io.micronaut.session.SessionStore<io.micronaut.session.Session> sessionStore) -
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.
-
Constructor Details
-
SessionPkcePersistence
public SessionPkcePersistence(io.micronaut.session.SessionStore<io.micronaut.session.Session> sessionStore) - Parameters:
sessionStore
- The session store
-
-
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
-