Class AbstractAccessTokenCookieConfigurationProperties
- java.lang.Object
-
- io.micronaut.security.token.jwt.cookie.AbstractAccessTokenCookieConfigurationProperties
-
- All Implemented Interfaces:
io.micronaut.core.util.Toggleable,io.micronaut.http.cookie.CookieConfiguration,io.micronaut.security.config.TokenCookieConfiguration
- Direct Known Subclasses:
JwtCookieConfigurationProperties,RefreshTokenCookieConfigurationProperties
public abstract class AbstractAccessTokenCookieConfigurationProperties extends java.lang.Object implements io.micronaut.security.config.TokenCookieConfigurationBase class for cookie configuration properties classes.- Since:
- 3.4.2
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringcookieDomainprotected java.lang.BooleancookieHttpOnlyprotected java.time.DurationcookieMaxAgeprotected io.micronaut.http.cookie.SameSitecookieSameSiteprotected java.lang.BooleancookieSecurestatic io.micronaut.http.cookie.SameSiteDEFAULT_COOKIESAMESITEThe default same-site setting for the JWT cookie.static booleanDEFAULT_HTTPONLYThe default http only value.
-
Constructor Summary
Constructors Constructor Description AbstractAccessTokenCookieConfigurationProperties()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<java.lang.String>getCookieDomain()java.util.Optional<java.time.temporal.TemporalAmount>getCookieMaxAge()java.util.Optional<io.micronaut.http.cookie.SameSite>getCookieSameSite()java.util.Optional<java.lang.Boolean>isCookieHttpOnly()java.util.Optional<java.lang.Boolean>isCookieSecure()voidsetCookieDomain(java.lang.String cookieDomain)Sets the domain name of this Cookie.voidsetCookieHttpOnly(java.lang.Boolean cookieHttpOnly)Whether the Cookie can only be accessed via HTTP.voidsetCookieMaxAge(java.time.Duration cookieMaxAge)Sets the maximum age of the cookie.voidsetCookieSameSite(io.micronaut.http.cookie.SameSite cookieSameSite)Sets the same-site setting of the cookie.voidsetCookieSecure(java.lang.Boolean cookieSecure)Sets whether the cookie is secured.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Field Detail
-
DEFAULT_HTTPONLY
public static final boolean DEFAULT_HTTPONLY
The default http only value.- See Also:
- Constant Field Values
-
DEFAULT_COOKIESAMESITE
public static final io.micronaut.http.cookie.SameSite DEFAULT_COOKIESAMESITE
The default same-site setting for the JWT cookie.
-
cookieDomain
protected java.lang.String cookieDomain
-
cookieHttpOnly
protected java.lang.Boolean cookieHttpOnly
-
cookieSecure
protected java.lang.Boolean cookieSecure
-
cookieMaxAge
protected java.time.Duration cookieMaxAge
-
cookieSameSite
protected io.micronaut.http.cookie.SameSite cookieSameSite
-
-
Method Detail
-
getCookieDomain
public java.util.Optional<java.lang.String> getCookieDomain()
- Specified by:
getCookieDomainin interfaceio.micronaut.http.cookie.CookieConfiguration- Returns:
- the domain name of this Cookie
-
isCookieHttpOnly
public java.util.Optional<java.lang.Boolean> isCookieHttpOnly()
- Specified by:
isCookieHttpOnlyin interfaceio.micronaut.http.cookie.CookieConfiguration- Returns:
- Whether the Cookie can only be accessed via HTTP.
-
isCookieSecure
public java.util.Optional<java.lang.Boolean> isCookieSecure()
- Specified by:
isCookieSecurein interfaceio.micronaut.http.cookie.CookieConfiguration- Returns:
- True if the cookie is secure
-
getCookieMaxAge
public java.util.Optional<java.time.temporal.TemporalAmount> getCookieMaxAge()
- Specified by:
getCookieMaxAgein interfaceio.micronaut.http.cookie.CookieConfiguration- Returns:
- The max age to use for the cookie
-
getCookieSameSite
public java.util.Optional<io.micronaut.http.cookie.SameSite> getCookieSameSite()
- Specified by:
getCookieSameSitein interfaceio.micronaut.http.cookie.CookieConfiguration
-
setCookieDomain
public void setCookieDomain(@Nullable java.lang.String cookieDomain)Sets the domain name of this Cookie.- Parameters:
cookieDomain- the domain name of this Cookie
-
setCookieHttpOnly
public void setCookieHttpOnly(java.lang.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(java.lang.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(java.time.Duration cookieMaxAge)
Sets the maximum age of the cookie.- Parameters:
cookieMaxAge- The maximum age of the cookie
-
setCookieSameSite
public void setCookieSameSite(@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.
-
-