package jwt
- Alphabetic
- Public
- Protected
Package Members
- package algorithms
- package exceptions
Type Members
- class Jwt extends JwtCore[JwtHeader, JwtClaim]
- sealed trait JwtAlgorithm extends AnyRef
- class JwtArgonaut extends JwtArgonautParser[JwtHeader, JwtClaim]
- trait JwtArgonautParser[H, C] extends JwtJsonCommon[Json, H, C]
- class JwtCirce extends JwtCirceParser[JwtHeader, JwtClaim]
- trait JwtCirceParser[H, C] extends JwtJsonCommon[Json, H, C]
Implementation of
JwtCore
usingJson
from Circe. - class JwtClaim extends AnyRef
- trait JwtCore[H, C] extends AnyRef
Provide the main logic around Base64 encoding / decoding and signature using the correct algorithm.
Provide the main logic around Base64 encoding / decoding and signature using the correct algorithm. H and C types are respesctively the header type and the claim type. For the core project, they will be String but you are free to extend this trait using other types like JsObject or anything else.
Please, check implementations, like Jwt, for code samples.
- H
the type of the extracted header from a JSON Web Token
- C
the type of the extracted claim from a JSON Web Token
- class JwtHeader extends AnyRef
- class JwtJson extends JwtJsonParser[JwtHeader, JwtClaim]
- class JwtJson4s extends JwtJson4sParser[JwtHeader, JwtClaim]
- trait JwtJson4sImplicits extends AnyRef
- trait JwtJson4sParser[H, C] extends JwtJson4sCommon[H, C] with JwtJson4sImplicits
Implementation of
JwtCore
usingJObject
from Json4s Native.Implementation of
JwtCore
usingJObject
from Json4s Native.To see a full list of samples, check the online documentation.
- trait JwtJsonImplicits extends AnyRef
- trait JwtJsonParser[H, C] extends JwtJsonCommon[JsObject, H, C] with JwtJsonImplicits
Implementation of
JwtCore
usingJsObject
from Play JSON.Implementation of
JwtCore
usingJsObject
from Play JSON.To see a full list of samples, check the online documentation.
- case class JwtOptions(signature: Boolean = true, expiration: Boolean = true, notBefore: Boolean = true, leeway: Long = 0) extends Product with Serializable
- trait JwtPlayImplicits extends AnyRef
- 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].
Similar to the default Play Session but using JsObject instead of Map[String, String]. The data is separated into two attributes:
headerData
andclaimData
. There is also a optional signature. Most of the time, you should only care about theclaimData
which stores the claim of the token containing the custom values you eventually put in it. That's why all methods ofJwtSession
(such as add and removing values) only modifiy theclaimData
.To see a full list of samples, check the online documentation.
Warning Be aware that if you override the
claimData
(usingwithClaim
for example), you might override some attributes that were automatically put inside the claim such as the expiration of the token. - class JwtUpickle extends JwtUpickleParser[JwtHeader, JwtClaim]
- trait JwtUpickleImplicits extends AnyRef
- trait JwtUpickleParser[H, C] extends JwtJsonCommon[Value, H, C] with JwtUpickleImplicits
Implementation of
JwtCore
usingJs.Value
from uPickle.Implementation of
JwtCore
usingJs.Value
from uPickle.To see a full list of samples, check the online documentation.
- class JwtZIOJson extends JwtZIOJsonParser[JwtHeader, JwtClaim]
- trait JwtZIOJsonParser[H, C] extends JwtJsonCommon[Json, H, C]
Value Members
- object Jwt extends Jwt
Test implementation of JwtCore using only Strings.
Test implementation of JwtCore using only Strings. Most of the time, you should use a lib implementing JSON and shouldn't be using this object. But just in case you need pure Scala support, here it is.
To see a full list of samples, check the online documentation.
Warning: since there is no JSON support in Scala, this object doesn't have any way to parse a JSON string as an AST, so it only uses regex with all the limitations it implies. Try not to use keys like
exp
andnbf
in sub-objects of the claim. For example, if you try to use the following claim:{"user":{"exp":1},"exp":1300819380}
, it should be correct but it will fail because the regex extracting the expiration will return1
instead of1300819380
. Sorry about that. - object JwtAlgorithm
- object JwtArgonaut extends JwtArgonaut
- object JwtArrayUtils
- object JwtBase64
- object JwtCirce extends JwtCirce
- object JwtClaim
- object JwtHeader
- object JwtJson extends JwtJson
- object JwtJson4s extends JwtJson4s
- object JwtOptions extends Serializable
- object JwtSession extends JwtJsonImplicits with JwtPlayImplicits with Serializable
- object JwtTime
Util object to handle time operations
- object JwtUpickle extends JwtUpickle
- object JwtUtils
- object JwtZIOJson extends JwtZIOJson