pdi.jwt

JwtSession

Related Docs: object JwtSession | package jwt

case class JwtSession(headerData: JsObject, claimData: JsObject, signature: String) 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
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. JwtSession
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new JwtSession(headerData: JsObject, claimData: JsObject, signature: String)

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[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  15. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  16. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. def get(fieldName: String): Option[JsValue]

    Retrieve the value corresponding to fieldName from claimData

  18. 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.

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

    Definition Classes
    AnyRef → Any
  20. def header: JwtHeader

  21. val headerData: JsObject

  22. def isEmpty(): Boolean

  23. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  24. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  25. final def notify(): Unit

    Definition Classes
    AnyRef
  26. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  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(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  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)

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped