package state
- Alphabetic
- Public
- Protected
Type Members
- case class CsrfStateItem(token: String) extends SocialStateItem with Product with Serializable
The item the handler can handle.
The item the handler can handle.
- token
A unique token used to protect the application against CSRF attacks.
- class CsrfStateItemHandler extends SocialStateItemHandler with api.Logger with PublishableSocialStateItemHandler
Protects the application against CSRF attacks.
Protects the application against CSRF attacks.
The handler stores a unique token in provider state and the same token in a signed client side cookie. After the provider redirects back to the application both tokens will be compared. If both tokens are the same than the application can trust the redirect source.
- case class CsrfStateSettings(cookieName: String = "CsrfState", cookiePath: String = "/", cookieDomain: Option[String] = None, secureCookie: Boolean = true, httpOnlyCookie: Boolean = true, sameSite: Option[SameSite] = Some(Cookie.SameSite.Lax), expirationTime: FiniteDuration = 5.minutes) extends Product with Serializable
The settings for the Csrf State.
The settings for the Csrf State.
- cookieName
The cookie name.
- cookiePath
The cookie path.
- cookieDomain
The cookie domain.
- secureCookie
Whether this cookie is secured, sent only for HTTPS requests.
- httpOnlyCookie
Whether this cookie is HTTP only, i.e. not accessible from client-side JavaScript code.
- sameSite
The SameSite attribute for this cookie (for CSRF protection).
- expirationTime
State expiration. Defaults to 5 minutes which provides sufficient time to log in, but not too much. This is a balance between convenience and security.
- case class UserStateItem(state: Map[String, String]) extends SocialStateItem with Product with Serializable
A default user state item where state is of type Map[String, String].
- class UserStateItemHandler[S <: SocialStateItem] extends SocialStateItemHandler
Handles user defined state.
Handles user defined state.
- S
The type of the user state.
Value Members
- object CsrfStateItem extends Serializable
The companion object of the CsrfStateItem.
- object CsrfStateItemHandler
The companion object.
- object UserStateItem extends Serializable
The companion object of the UserStateItem.
- object UserStateItemHandler
The companion object.