Class/Object

com.mohiva.play.silhouette.impl.authenticators

CookieAuthenticator

Related Docs: object CookieAuthenticator | package authenticators

Permalink

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. None for a transient cookie.

fingerprint

Maybe a fingerprint of the user.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. CookieAuthenticator
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. ExpirableAuthenticator
  7. StorableAuthenticator
  8. Authenticator
  9. AnyRef
  10. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new CookieAuthenticator(id: String, loginInfo: LoginInfo, lastUsedDateTime: DateTime, expirationDateTime: DateTime, idleTimeout: Option[FiniteDuration], cookieMaxAge: Option[FiniteDuration], fingerprint: Option[String])

    Permalink

    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. None for a transient cookie.

    fingerprint

    Maybe a fingerprint of the user.

Type Members

  1. abstract type Settings

    Permalink

    The type of the settings an authenticator can handle.

    The type of the settings an authenticator can handle.

    Definition Classes
    Authenticator
  2. type Value = Cookie

    Permalink

    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
    CookieAuthenticatorAuthenticator

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. val cookieMaxAge: Option[FiniteDuration]

    Permalink

    The duration a cookie expires.

    The duration a cookie expires. None for a transient cookie.

  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. val expirationDateTime: DateTime

    Permalink

    The expiration date/time.

    The expiration date/time.

    Definition Classes
    CookieAuthenticatorExpirableAuthenticator
  9. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. val fingerprint: Option[String]

    Permalink

    Maybe a fingerprint of the user.

  11. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  12. val id: String

    Permalink

    The authenticator ID.

    The authenticator ID.

    Definition Classes
    CookieAuthenticatorStorableAuthenticator
  13. val idleTimeout: Option[FiniteDuration]

    Permalink

    The duration an authenticator can be idle before it timed out.

    The duration an authenticator can be idle before it timed out.

    Definition Classes
    CookieAuthenticatorExpirableAuthenticator
  14. def isExpired: Boolean

    Permalink

    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
  15. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  16. def isTimedOut: Boolean

    Permalink

    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
  17. def isValid: Boolean

    Permalink

    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
    ExpirableAuthenticatorAuthenticator
  18. val lastUsedDateTime: DateTime

    Permalink

    The last used date/time.

    The last used date/time.

    Definition Classes
    CookieAuthenticatorExpirableAuthenticator
  19. val loginInfo: LoginInfo

    Permalink

    The linked login info for an identity.

    The linked login info for an identity.

    Definition Classes
    CookieAuthenticatorAuthenticator
  20. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  21. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  23. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  24. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from ExpirableAuthenticator

Inherited from StorableAuthenticator

Inherited from Authenticator

Inherited from AnyRef

Inherited from Any

Ungrouped