Package io.karatelabs.http
Enum Class SameSite
- All Implemented Interfaces:
Serializable,Comparable<SameSite>,Constable
SameSite cookie attribute values per RFC 6265bis.
Used by ServerConfig.sessionSameSite(SameSite) to control whether
the session cookie is attached on cross-site navigations.
STRICT— never sent on any cross-site request. Strongest CSRF defense, but breaks OAuth callbacks (the IdP redirects back to your /signin?code=... and the browser drops the cookie).LAX— sent on top-level navigations using safe methods (GET). This is the framework default and works for OAuth callbacks that useresponse_mode=query, where the IdP issues a 302 GET back.NONE— sent on all cross-site requests, including top-level POSTs. Required for OAuth/OIDC flows that useresponse_mode=form_post(e.g. Microsoft / Azure AD via MSAL4J >= 1.18, which deprecated QUERY and force-overrides to FORM_POST). ImpliesSecure— the browser refusesSameSite=Nonecookies that lackSecure, soSecureis added automatically byServerRequestHandleroutside dev mode. Pair with explicit CSRF tokens (already enforced byCsrfProtection) since SameSite is no longer a defense layer.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
-
Enum Constant Details
-
STRICT
-
LAX
-
NONE
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
headerValue
The exact attribute value to emit in theSet-Cookieheader.
-