Class AbstractAccessTokenCookieConfigurationProperties

java.lang.Object
io.micronaut.security.token.cookie.AbstractAccessTokenCookieConfigurationProperties
All Implemented Interfaces:
io.micronaut.core.util.Toggleable, io.micronaut.http.cookie.CookieConfiguration, TokenCookieConfiguration
Direct Known Subclasses:
RefreshTokenCookieConfigurationProperties, TokenCookieConfigurationProperties

public abstract class AbstractAccessTokenCookieConfigurationProperties extends Object implements TokenCookieConfiguration
Base class for cookie configuration properties classes.
Since:
3.4.2
Author:
Álvaro Sánchez-Mariscal
  • Field Details

    • DEFAULT_HTTPONLY

      public static final boolean DEFAULT_HTTPONLY
      The default http only value.
      See Also:
    • DEFAULT_COOKIESAMESITE

      public static final io.micronaut.http.cookie.SameSite DEFAULT_COOKIESAMESITE
      The default same-site setting for the JWT cookie.
    • cookieDomain

      protected String cookieDomain
    • cookieHttpOnly

      protected Boolean cookieHttpOnly
    • cookieSecure

      protected Boolean cookieSecure
    • cookieMaxAge

      protected Duration cookieMaxAge
    • cookieSameSite

      protected io.micronaut.http.cookie.SameSite cookieSameSite
  • Constructor Details

    • AbstractAccessTokenCookieConfigurationProperties

      public AbstractAccessTokenCookieConfigurationProperties()
  • Method Details

    • getCookieDomain

      public Optional<String> getCookieDomain()
      Specified by:
      getCookieDomain in interface io.micronaut.http.cookie.CookieConfiguration
      Returns:
      the domain name of this Cookie
    • isCookieHttpOnly

      public Optional<Boolean> isCookieHttpOnly()
      Specified by:
      isCookieHttpOnly in interface io.micronaut.http.cookie.CookieConfiguration
      Returns:
      Whether the Cookie can only be accessed via HTTP.
    • isCookieSecure

      public Optional<Boolean> isCookieSecure()
      Specified by:
      isCookieSecure in interface io.micronaut.http.cookie.CookieConfiguration
      Returns:
      True if the cookie is secure
    • getCookieMaxAge

      public Optional<TemporalAmount> getCookieMaxAge()
      Specified by:
      getCookieMaxAge in interface io.micronaut.http.cookie.CookieConfiguration
      Returns:
      The max age to use for the cookie
    • getCookieSameSite

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

      public void setCookieDomain(@Nullable @Nullable String cookieDomain)
      Sets the domain name of this Cookie.
      Parameters:
      cookieDomain - the domain name of this Cookie
    • 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
    • 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
    • setCookieMaxAge

      public void setCookieMaxAge(Duration cookieMaxAge)
      Sets the maximum age of the cookie.
      Parameters:
      cookieMaxAge - The maximum age of the cookie
    • setCookieSameSite

      public void setCookieSameSite(@Nullable @Nullable io.micronaut.http.cookie.SameSite cookieSameSite)
      Sets the same-site setting of the cookie. Default value null. Value is case sensitive. Allowed values: `Strict`, `Lax` or `None`.
      Parameters:
      cookieSameSite - The same-site setting of the cookie.