java.lang.Object
io.micronaut.security.oauth2.endpoint.nonce.persistence.session.SessionNoncePersistence
All Implemented Interfaces:
NoncePersistence

@Requires(beans=io.micronaut.session.SessionStore.class) @Requires(property="micronaut.security.oauth2.openid.nonce.persistence",value="session") @Singleton public class SessionNoncePersistence extends Object implements NoncePersistence
Persists the state in the session.
Since:
1.2.0
Author:
James Kleeh
  • Constructor Details

    • SessionNoncePersistence

      public SessionNoncePersistence(io.micronaut.session.SessionStore<io.micronaut.session.Session> sessionStore)
      Parameters:
      sessionStore - The session store
  • Method Details

    • retrieveNonce

      public Optional<String> retrieveNonce(io.micronaut.http.HttpRequest<?> request)
      Description copied from interface: NoncePersistence
      Retrieves and removes the nonce from persistence.
      Specified by:
      retrieveNonce in interface NoncePersistence
      Parameters:
      request - The request
      Returns:
      The optional nonce
    • persistNonce

      public void persistNonce(io.micronaut.http.HttpRequest<?> request, io.micronaut.http.MutableHttpResponse response, String state)
      Description copied from interface: NoncePersistence
      Persists the nonce for later retrieval to allow validation.
      Specified by:
      persistNonce in interface NoncePersistence
      Parameters:
      request - The login request
      response - The authorization redirect response
      state - The nonce to persist