case class JwtSession(headerData: JsObject, claimData: JsObject, signature: String)(implicit conf: Configuration, clock: Clock) extends Product with Serializable

Similar to the default Play Session but using JsObject instead of Map[String, String]. The data is separated into two attributes: headerData and claimData. There is also a optional signature. Most of the time, you should only care about the claimData which stores the claim of the token containing the custom values you eventually put in it. That's why all methods of JwtSession (such as add and removing values) only modifiy the claimData.

To see a full list of samples, check the online documentation.

Warning Be aware that if you override the claimData (using withClaim for example), you might override some attributes that were automatically put inside the claim such as the expiration of the token.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. JwtSession
  2. Serializable
  3. Product
  4. Equals
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new JwtSession(headerData: JsObject, claimData: JsObject, signature: String)(implicit conf: Configuration, clock: Clock)
    Annotations
    @Inject()

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def +[T](key: String, value: T)(implicit writer: Writes[T]): JwtSession

    Convert value to its JSON counterpart and add it to claimData

  4. def +(key: String, value: JsValueWrapper): JwtSession

    Add this (key, value) to claimData (existing key will be overriden)

  5. def +(value: JsObject): JwtSession

    Merge the value with claimData

  6. def ++(fields: (String, JsValueWrapper)*): JwtSession

    Add a sequence of (key, value) to claimData

  7. def -(fieldName: String): JwtSession

    Remove one key from claimData

  8. def --(fieldNames: String*): JwtSession

    Remove a sequence of keys from claimData

  9. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  10. def apply(fieldName: String): Option[JsValue]

    Alias of get

  11. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  12. def claim: JwtClaim
  13. val claimData: JsObject
  14. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
  15. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. def get(fieldName: String): Option[JsValue]

    Retrieve the value corresponding to fieldName from claimData

  17. def getAs[T](fieldName: String)(implicit reader: Reads[T]): Option[T]

    After retrieving the value, try to read it as T, if no value or fails, returns None.

  18. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  19. def header: JwtHeader
  20. val headerData: JsObject
  21. def isEmpty(): Boolean
  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  24. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  25. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  26. def productElementNames: Iterator[String]
    Definition Classes
    Product
  27. def refresh(): JwtSession

    If your Play app config has a session.maxAge, it will extend the expiration by that amount

  28. def serialize: String

    Encode the session as a JSON Web Token

  29. val signature: String
  30. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  31. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  32. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  33. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  34. def withClaim(claim: JwtClaim): JwtSession

    Overrride the claimData

  35. def withHeader(header: JwtHeader): JwtSession

    Override the headerData

  36. def withSignature(signature: String): JwtSession

    Override the signature (seriously, you should never need this method)

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped