@Requires(condition=CookieBasedAuthenticationModeCondition.class) @Requires(property="micronaut.security.token.jwt.cookie.enabled",notEquals="false",defaultValue="true") @ConfigurationProperties(value="micronaut.security.token.jwt.cookie") public class JwtCookieConfigurationProperties extends java.lang.Object implements AccessTokenCookieConfiguration
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_COOKIENAME
The default cookie name.
|
static java.lang.String |
DEFAULT_COOKIEPATH
Default Cookie Path.
|
static io.micronaut.http.cookie.SameSite |
DEFAULT_COOKIESAMESITE
The default same-site setting for the JWT cookie.
|
static boolean |
DEFAULT_ENABLED
The default enable value.
|
static boolean |
DEFAULT_HTTPONLY
The default http only value.
|
static java.lang.String |
PREFIX |
Constructor and Description |
---|
JwtCookieConfigurationProperties() |
Modifier and Type | Method and Description |
---|---|
java.util.Optional<java.lang.String> |
getCookieDomain() |
java.util.Optional<java.time.temporal.TemporalAmount> |
getCookieMaxAge() |
java.lang.String |
getCookieName() |
java.util.Optional<java.lang.String> |
getCookiePath() |
java.util.Optional<io.micronaut.http.cookie.SameSite> |
getCookieSameSite() |
java.util.Optional<java.lang.Boolean> |
isCookieHttpOnly() |
java.util.Optional<java.lang.Boolean> |
isCookieSecure() |
boolean |
isEnabled() |
void |
setCookieDomain(java.lang.String cookieDomain)
Sets the domain name of this Cookie.
|
void |
setCookieHttpOnly(java.lang.Boolean cookieHttpOnly)
Whether the Cookie can only be accessed via HTTP.
|
void |
setCookieMaxAge(java.time.Duration cookieMaxAge)
Sets the maximum age of the cookie.
|
void |
setCookieName(java.lang.String cookieName)
Cookie Name.
|
void |
setCookiePath(java.lang.String cookiePath)
Sets the path of the cookie.
|
void |
setCookieSameSite(io.micronaut.http.cookie.SameSite cookieSameSite)
Sets the same-site setting of the cookie.
|
void |
setCookieSecure(java.lang.Boolean cookieSecure)
Sets whether the cookie is secured.
|
void |
setEnabled(boolean enabled)
Sets whether JWT cookie configuration is enabled.
|
public static final java.lang.String PREFIX
public static final boolean DEFAULT_ENABLED
public static final boolean DEFAULT_HTTPONLY
public static final java.lang.String DEFAULT_COOKIENAME
public static final java.lang.String DEFAULT_COOKIEPATH
public static final io.micronaut.http.cookie.SameSite DEFAULT_COOKIESAMESITE
public boolean isEnabled()
isEnabled
in interface io.micronaut.core.util.Toggleable
public void setEnabled(boolean enabled)
enabled
- True if it is enabledpublic void setCookieName(java.lang.String cookieName)
cookieName
- Cookie name@NonNull public java.lang.String getCookieName()
getCookieName
in interface io.micronaut.http.cookie.CookieConfiguration
public java.util.Optional<java.lang.String> getCookieDomain()
getCookieDomain
in interface io.micronaut.http.cookie.CookieConfiguration
@Nullable public java.util.Optional<java.lang.String> getCookiePath()
getCookiePath
in interface io.micronaut.http.cookie.CookieConfiguration
public java.util.Optional<java.lang.Boolean> isCookieHttpOnly()
isCookieHttpOnly
in interface io.micronaut.http.cookie.CookieConfiguration
public java.util.Optional<java.lang.Boolean> isCookieSecure()
isCookieSecure
in interface io.micronaut.http.cookie.CookieConfiguration
public java.util.Optional<java.time.temporal.TemporalAmount> getCookieMaxAge()
getCookieMaxAge
in interface io.micronaut.http.cookie.CookieConfiguration
public java.util.Optional<io.micronaut.http.cookie.SameSite> getCookieSameSite()
getCookieSameSite
in interface io.micronaut.http.cookie.CookieConfiguration
public void setCookieDomain(@Nullable java.lang.String cookieDomain)
cookieDomain
- the domain name of this Cookiepublic void setCookiePath(@Nullable java.lang.String cookiePath)
cookiePath
- The path of the cookie.public void setCookieHttpOnly(java.lang.Boolean cookieHttpOnly)
cookieHttpOnly
- Whether the Cookie can only be accessed via HTTPpublic void setCookieSecure(java.lang.Boolean cookieSecure)
cookieSecure
- True if the cookie is securepublic void setCookieMaxAge(java.time.Duration cookieMaxAge)
cookieMaxAge
- The maximum age of the cookiepublic void setCookieSameSite(@Nullable io.micronaut.http.cookie.SameSite cookieSameSite)
cookieSameSite
- The same-site setting of the cookie.