pdi

jwt

package jwt

Linear Supertypes
JwtPlayImplicits, JwtJsonImplicits, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. jwt
  2. JwtPlayImplicits
  3. JwtJsonImplicits
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. trait JwtPlayImplicits extends AnyRef

  2. 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].

    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.

  3. implicit class RichJwtClaim extends AnyRef

    Definition Classes
    JwtJsonImplicits
  4. implicit class RichJwtHeader extends AnyRef

    Definition Classes
    JwtJsonImplicits
  5. implicit class RichRequestHeader extends AnyRef

    By adding import pdi.jwt._, you will implicitely add this method to RequestHeader allowing you to easily retrieve the JwtSession inside your Play application.

    By adding import pdi.jwt._, you will implicitely add this method to RequestHeader allowing you to easily retrieve the JwtSession inside your Play application.

    package controllers
    
    import play.api._
    import play.api.mvc._
    import pdi.jwt._
    
    object Application extends Controller {
      def index = Action { request =>
        val session: JwtSession = request.jwtSession
      }
    }
    Definition Classes
    JwtPlayImplicits
  6. implicit class RichResult extends AnyRef

    By adding import pdi.jwt._, you will implicitely add all those methods to Result allowing you to easily manipulate the JwtSession inside your Play application.

    By adding import pdi.jwt._, you will implicitely add all those methods to Result allowing you to easily manipulate the JwtSession inside your Play application.

    package controllers
    
    import play.api._
    import play.api.mvc._
    import pdi.jwt._
    
    object Application extends Controller {
      def login = Action { implicit request =>
        Ok.addingToJwtSession(("logged", true))
      }
    
      def logout = Action { implicit request =>
        Ok.withoutJwtSession
      }
    }
    Definition Classes
    JwtPlayImplicits

Value Members

  1. object JwtSession extends Serializable

  2. implicit val jwtClaimReader: Reads[JwtClaim]

    Definition Classes
    JwtJsonImplicits
  3. implicit val jwtClaimWriter: Writes[JwtClaim]

    Definition Classes
    JwtJsonImplicits
  4. implicit val jwtHeaderReader: Reads[JwtHeader]

    Definition Classes
    JwtJsonImplicits
  5. implicit val jwtHeaderWriter: Writes[JwtHeader]

    Definition Classes
    JwtJsonImplicits

Inherited from JwtPlayImplicits

Inherited from JwtJsonImplicits

Inherited from AnyRef

Inherited from Any

Ungrouped