Jwt
Pure-Scala JWT implementation (RFC 7519).
==Minimal usage==
JvmJwtCryptoBackend.install() // once at startup
val token = Jwt.sign(claims, key, Algorithm.HS256).getOrElse(throw new RuntimeException(...))
val claims = Jwt.decode(token, key, Algorithm.HS256).getOrElse(throw new RuntimeException(...))
Attributes
Members list
Value members
Concrete methods
Decodes and verifies a compact JWT string (legacy overload).
Decodes and verifies a compact JWT string (legacy overload).
Value parameters
- alg
-
the expected signing algorithm
- clockSkewSeconds
-
allowable clock skew in seconds for
exp/nbfvalidation - issuer
-
if set, the
issclaim must match exactly - key
-
the secret or public key bytes
- token
-
the compact three-segment JWT
Attributes
- Source
- Jwt.scala
Decodes with explicit backend (snapshot once per operation).
Decodes with explicit backend and nowSeconds.
Decodes with full decode options.
Decodes a compact JWT without verifying the signature or validating claims. Useful for inspecting the header/payload of an untrusted token.
Decodes a compact JWT without verifying the signature or validating claims. Useful for inspecting the header/payload of an untrusted token.
This method is kept for compatibility. Prefer decodeWithoutVerification for new code.
Attributes
- Source
- Jwt.scala
Compatibility alias for decodeUnsafe with limits.
Decodes a compact JWT without verifying the signature or validating claims.
Decodes a compact JWT without verifying the signature or validating claims.
Value parameters
- limits
-
resource limits
- token
-
compact JWT string
Attributes
- Source
- Jwt.scala
Signs claims with key and alg, returning a compact JWT string.
Signs claims with key and alg using an explicit header. Returns an error if header.alg != alg.
Signs claims with key and alg using an explicit header. Returns an error if header.alg != alg.
Attributes
- Source
- Jwt.scala
Signs with explicit backend (snapshot once per operation).
Signs with explicit sign options.