These docs are for v2.0. Click to read the latest docs for v7.0.

Authenticators

CookieAuthenticator

To configure the CookieAuthenticator service you must use the CookieAuthenticatorSettings class. This class has the following form:

case class CookieAuthenticatorSettings(
  cookieName: String = "id",
  cookiePath: String = "/",
  cookieDomain: Option[String] = None,
  secureCookie: Boolean = Play.isProd,
  httpOnlyCookie: Boolean = true,
  useFingerprinting: Boolean = true,
  cookieMaxAge: Option[Int] = Some(12 * 60 * 60),
  authenticatorIdleTimeout: Option[Int] = Some(30 * 60),
  authenticatorExpiry: Int = 12 * 60 * 60)
PropertyDescription
cookieNameThe cookie name
cookiePathThe cookie path
cookieDomainThe cookie domain
secureCookieWhether this cookie is secured, sent only for HTTPS requests. Default to sending only for HTTPS in production, but not for development and test
httpOnlyCookieWhether this cookie is HTTP only, i.e. not accessible from client-side JavaScript code
useFingerprintingIndicates if a fingerprint of the user should be stored in the authenticator
cookieMaxAgeThe cookie expiration date in seconds, None for a transient cookie. Defaults to 12 hours
authenticatorIdleTimeoutThe time in seconds an authenticator can be idle before it timed out. Defaults to 30 minutes
authenticatorExpiryThe expiry of the authenticator in seconds. Defaults to 12 hours

SessionAuthenticator

To configure the SessionAuthenticator service you must use the SessionAuthenticatorSettings class. This class has the following form:

case class SessionAuthenticatorSettings(
  sessionKey: String = "authenticator",
  encryptAuthenticator: Boolean = true,
  useFingerprinting: Boolean = true,
  authenticatorIdleTimeout: Option[Int] = Some(30 * 60),
  authenticatorExpiry: Int = 12 * 60 * 60)
PropertyDescription
sessionKeyThe key of the authenticator in the session
encryptAuthenticatorIndicates if the authenticator should be encrypted in session
useFingerprintingIndicates if a fingerprint of the user should be stored in the
authenticatorIdleTimeoutThe time in seconds an authenticator can be idle before it timed out. Defaults to 30 minutes
authenticatorExpiryThe expiry of the authenticator in seconds. Defaults to 12 hours

BearerTokenAuthenticator

To configure the BearerTokenAuthenticator service you must use the BearerTokenAuthenticatorSettings class. This class has the following form:

case class BearerTokenAuthenticatorSettings(
  headerName: String = "X-Auth-Token",
  authenticatorIdleTimeout: Option[Int] = Some(30 * 60),
  authenticatorExpiry: Int = 12 * 60 * 60)
PropertyDescription
headerNameThe name of the header in which the token will be transfered
authenticatorIdleTimeoutThe time in seconds an authenticator can be idle before it timed out. Defaults to 30 minutes
authenticatorExpiryThe expiry of the authenticator in seconds. Defaults to 12 hours

JWTAuthenticator

To configure the JWTAuthenticator service you must use the JWTAuthenticatorSettings
class. This class has the following form:

case class JWTAuthenticatorSettings(
  headerName: String = "X-Auth-Token",
  issuerClaim: String = "play-silhouette",
  encryptSubject: Boolean = true,
  authenticatorIdleTimeout: Option[Int] = None,
  authenticatorExpiry: Int = 12 * 60 * 60,
  sharedSecret: String)
PropertyDescription
headerNameThe name of the header in which the token will be transfered
issuerClaimThe issuer claim identifies the principal that issued the JWT
encryptSubjectIndicates if the subject should be encrypted in JWT
authenticatorIdleTimeoutThe time in seconds an authenticator can be idle before it timed out. This feature is disabled by default to prevent the generation of a new JWT on every request
authenticatorExpiryThe expiry of the authenticator in seconds. Defaults to 12 hours
sharedSecretThe shared secret to sign the JWT