Class AbstractCookieConfiguration

java.lang.Object
io.micronaut.security.oauth2.endpoint.AbstractCookieConfiguration
All Implemented Interfaces:
io.micronaut.http.cookie.CookieConfiguration
Direct Known Subclasses:
CookieNoncePersistenceConfiguration, CookiePkcePersistenceConfiguration, CookieStatePersistenceConfiguration

public abstract class AbstractCookieConfiguration extends Object implements io.micronaut.http.cookie.CookieConfiguration
Base configuration for CookieConfiguration implementations.
Author:
Álvaro Sánchez-Mariscal
  • Field Details

    • cookieDomain

      protected String cookieDomain
    • cookieSecure

      protected Boolean cookieSecure
    • cookiePath

      protected String cookiePath
    • cookieHttpOnly

      protected Boolean cookieHttpOnly
    • cookieMaxAge

      protected Duration cookieMaxAge
    • cookieName

      protected String cookieName
  • Constructor Details

    • AbstractCookieConfiguration

      public AbstractCookieConfiguration()
  • Method Details

    • getCookieDomain

      public Optional<String> getCookieDomain()
      Specified by:
      getCookieDomain in interface io.micronaut.http.cookie.CookieConfiguration
    • setCookieDomain

      public void setCookieDomain(@Nullable @Nullable String cookieDomain)
      Sets the domain name of this Cookie. Default value (null).
      Parameters:
      cookieDomain - the domain name of this Cookie
    • isCookieSecure

      public Optional<Boolean> isCookieSecure()
      Specified by:
      isCookieSecure in interface io.micronaut.http.cookie.CookieConfiguration
    • setCookieSecure

      public void setCookieSecure(Boolean cookieSecure)
      Sets whether the cookie is secured. Defaults to the secure status of the request.
      Parameters:
      cookieSecure - True if the cookie is secure
    • getCookieName

      @NonNull public @NonNull String getCookieName()
      Specified by:
      getCookieName in interface io.micronaut.http.cookie.CookieConfiguration
    • setCookieName

      public void setCookieName(@NonNull @NonNull String cookieName)
      Cookie Name.
      Parameters:
      cookieName - Cookie name
    • defaultCookieName

      public abstract String defaultCookieName()
    • getCookiePath

      public Optional<String> getCookiePath()
      Specified by:
      getCookiePath in interface io.micronaut.http.cookie.CookieConfiguration
    • setCookiePath

      public void setCookiePath(@Nullable @Nullable String cookiePath)
      Sets the path of the cookie. Default value ("/").
      Parameters:
      cookiePath - The path of the cookie.
    • isCookieHttpOnly

      public Optional<Boolean> isCookieHttpOnly()
      Specified by:
      isCookieHttpOnly in interface io.micronaut.http.cookie.CookieConfiguration
    • setCookieHttpOnly

      public void setCookieHttpOnly(Boolean cookieHttpOnly)
      Whether the Cookie can only be accessed via HTTP. Default value (true).
      Parameters:
      cookieHttpOnly - Whether the Cookie can only be accessed via HTTP
    • getCookieMaxAge

      public Optional<TemporalAmount> getCookieMaxAge()
      Specified by:
      getCookieMaxAge in interface io.micronaut.http.cookie.CookieConfiguration
    • setCookieMaxAge

      public void setCookieMaxAge(Duration cookieMaxAge)
      Sets the maximum age of the cookie. Default value (5 minutes).
      Parameters:
      cookieMaxAge - The maximum age of the cookie