Class CookiePersistence

java.lang.Object
io.micronaut.security.oauth2.endpoint.authorization.CookiePersistence
Direct Known Subclasses:
CookiePkcePersistence, CookieStatePersistence

public abstract class CookiePersistence extends Object
Utility Abstract class for Cookie Persistence.
Since:
3.9.0
Author:
Sergio del Amo
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final io.micronaut.http.cookie.CookieConfiguration
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    CookiePersistence(io.micronaut.http.cookie.CookieConfiguration cookieConfiguration)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Optional<String>
    retrieveValue(io.micronaut.http.HttpRequest<?> request)
     
    protected void
    save(@NonNull io.micronaut.http.HttpRequest<?> request, @NonNull io.micronaut.http.MutableHttpResponse<?> response, @Nullable String value)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • cookieConfiguration

      protected final io.micronaut.http.cookie.CookieConfiguration cookieConfiguration
  • Constructor Details

    • CookiePersistence

      protected CookiePersistence(io.micronaut.http.cookie.CookieConfiguration cookieConfiguration)
      Parameters:
      cookieConfiguration - Cookie Configuration
  • Method Details

    • retrieveValue

      protected Optional<String> retrieveValue(io.micronaut.http.HttpRequest<?> request)
      Parameters:
      request - Request
      Returns:
      The value of the cookie specified by CookieConfiguration.getCookieName()
    • save

      protected void save(@NonNull @NonNull io.micronaut.http.HttpRequest<?> request, @NonNull @NonNull io.micronaut.http.MutableHttpResponse<?> response, @Nullable @Nullable String value)
      Parameters:
      request - HTTP Request
      response - HTTP Response
      value - Saves a cookie with name CookieConfiguration.getCookieName() with supplied value in the HTTP response.