Class/Object

pdi.jwt

JwtSession

Related Docs: object JwtSession | package jwt

Permalink

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
Visibility
  1. Public
  2. All

Instance Constructors

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

    Permalink

Value Members

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +[T](key: String, value: T)(implicit writer: Writes[T]): JwtSession

    Permalink

    Convert value to its JSON counterpart and add it to claimData

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

    Permalink

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

  5. def +(value: JsObject): JwtSession

    Permalink

    Merge the value with claimData

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

    Permalink

    Add a sequence of (key, value) to claimData

  7. def -(fieldName: String): JwtSession

    Permalink

    Remove one key from claimData

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

    Permalink

    Remove a sequence of keys from claimData

  9. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def apply(fieldName: String): Option[JsValue]

    Permalink

    Alias of get

  11. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  12. def claim: JwtClaim

    Permalink
  13. val claimData: JsObject

    Permalink
  14. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  15. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. def finalize(): Unit

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

    Permalink

    Retrieve the value corresponding to fieldName from claimData

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

    Permalink

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  20. def header: JwtHeader

    Permalink
  21. val headerData: JsObject

    Permalink
  22. def isEmpty(): Boolean

    Permalink
  23. final def isInstanceOf[T0]: Boolean

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

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

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

    Permalink
    Definition Classes
    AnyRef
  27. def refresh(): JwtSession

    Permalink

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

  28. def serialize: String

    Permalink

    Encode the session as a JSON Web Token

  29. val signature: String

    Permalink
  30. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. def withClaim(claim: JwtClaim): JwtSession

    Permalink

    Overrride the claimData

  35. def withHeader(header: JwtHeader): JwtSession

    Permalink

    Override the headerData

  36. def withSignature(signature: String): JwtSession

    Permalink

    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