com.mohiva.play.silhouette.impl.authenticators
CookieAuthenticator
Companion object CookieAuthenticator
case class CookieAuthenticator(id: String, loginInfo: LoginInfo, lastUsedDateTime: DateTime, expirationDateTime: DateTime, idleTimeout: Option[FiniteDuration], cookieMaxAge: Option[FiniteDuration], fingerprint: Option[String]) extends StorableAuthenticator with ExpirableAuthenticator with Product with Serializable
An authenticator that uses a stateful as well as stateless, cookie based approach.
It works either by storing an ID in a cookie to track the authenticated user and a server side backing store that maps the ID to an authenticator instance or by a stateless approach that stores the authenticator in a serialized form directly into the cookie. The stateless approach could also be named “server side session”.
The authenticator can use sliding window expiration. This means that the authenticator times out after a certain time if it wasn't used. This can be controlled with the idleTimeout property.
With this authenticator it's possible to implement "Remember Me" functionality. This can be
achieved by updating the expirationDateTime, idleTimeout or cookieMaxAge properties of
this authenticator after it was created and before it gets initialized.
Note: If deploying to multiple nodes the backing store will need to synchronize.
- id
The authenticator ID.
- loginInfo
The linked login info for an identity.
- lastUsedDateTime
The last used date/time.
- expirationDateTime
The expiration date/time.
- idleTimeout
The duration an authenticator can be idle before it timed out.
- cookieMaxAge
The duration a cookie expires.
Nonefor a transient cookie.- fingerprint
Maybe a fingerprint of the user.
- Alphabetic
- By Inheritance
- CookieAuthenticator
- Serializable
- Serializable
- Product
- Equals
- ExpirableAuthenticator
- StorableAuthenticator
- Authenticator
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
CookieAuthenticator(id: String, loginInfo: LoginInfo, lastUsedDateTime: DateTime, expirationDateTime: DateTime, idleTimeout: Option[FiniteDuration], cookieMaxAge: Option[FiniteDuration], fingerprint: Option[String])
- id
The authenticator ID.
- loginInfo
The linked login info for an identity.
- lastUsedDateTime
The last used date/time.
- expirationDateTime
The expiration date/time.
- idleTimeout
The duration an authenticator can be idle before it timed out.
- cookieMaxAge
The duration a cookie expires.
Nonefor a transient cookie.- fingerprint
Maybe a fingerprint of the user.
Type Members
-
abstract
type
Settings
The type of the settings an authenticator can handle.
The type of the settings an authenticator can handle.
- Definition Classes
- Authenticator
-
type
Value = Cookie
The Type of the generated value an authenticator will be serialized to.
The Type of the generated value an authenticator will be serialized to.
- Definition Classes
- CookieAuthenticator → Authenticator
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
- val cookieMaxAge: Option[FiniteDuration]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
val
expirationDateTime: DateTime
The expiration date/time.
The expiration date/time.
- Definition Classes
- CookieAuthenticator → ExpirableAuthenticator
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- val fingerprint: Option[String]
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
val
id: String
Gets the ID to reference the authenticator in the backing store.
Gets the ID to reference the authenticator in the backing store.
- returns
The ID to reference the authenticator in the backing store.
- Definition Classes
- CookieAuthenticator → StorableAuthenticator
-
val
idleTimeout: Option[FiniteDuration]
The duration an authenticator can be idle before it timed out.
The duration an authenticator can be idle before it timed out.
- Definition Classes
- CookieAuthenticator → ExpirableAuthenticator
-
def
isExpired: Boolean
Checks if the authenticator is expired.
Checks if the authenticator is expired. This is an absolute timeout since the creation of the authenticator.
- returns
True if the authenticator is expired, false otherwise.
- Definition Classes
- ExpirableAuthenticator
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isTimedOut: Boolean
Checks if the time elapsed since the last time the authenticator was used, is longer than the maximum idle timeout specified in the properties.
Checks if the time elapsed since the last time the authenticator was used, is longer than the maximum idle timeout specified in the properties.
- returns
True if sliding window expiration is activated and the authenticator is timed out, false otherwise.
- Definition Classes
- ExpirableAuthenticator
-
def
isValid: Boolean
Checks if the authenticator isn't expired and isn't timed out.
Checks if the authenticator isn't expired and isn't timed out.
- returns
True if the authenticator isn't expired and isn't timed out.
- Definition Classes
- ExpirableAuthenticator → Authenticator
-
val
lastUsedDateTime: DateTime
The last used date/time.
The last used date/time.
- Definition Classes
- CookieAuthenticator → ExpirableAuthenticator
-
val
loginInfo: LoginInfo
Gets the linked login info for an identity.
Gets the linked login info for an identity.
- returns
The linked login info for an identity.
- Definition Classes
- CookieAuthenticator → Authenticator
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()