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

    Constructors
    Constructor
    Description
    SessionPkcePersistence(io.micronaut.session.SessionStore<io.micronaut.session.Session> sessionStore)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    persistPkce(@NonNull io.micronaut.http.HttpRequest<?> request, @NonNull io.micronaut.http.MutableHttpResponse<?> response, @NonNull Pkce pkce)
    Persists the PKCE for later retrieval.
    @NonNull Optional<String>
    retrieveCodeVerifier(@NonNull io.micronaut.http.HttpRequest<?> request)
    Retrieve the code verifier and removes it from the session if present.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 interface PkcePersistence
      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 interface PkcePersistence
      Parameters:
      request - The login request
      response - The authorization redirect response
      pkce - The PKCE to persist