p

pdi

jwt

package jwt

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. Protected

Package Members

  1. package algorithms
  2. package exceptions

Type Members

  1. sealed trait EcCurve extends AnyRef

    An elliptic curve usable in an EC JWK (RFC 7518 section 6.2.1.1).

  2. final class EcJwk extends Jwk

    Exceptions thrown

    JwtValidationException if a coordinate does not fit the curve length, is negative, or the point is not on the curve

  3. sealed trait Jwk extends AnyRef

    A public JSON Web Key as defined by RFC 7517.

    A public JSON Web Key as defined by RFC 7517.

    Only the public parameters of RSA, EC and OKP keys are modelled. Private members such as d, p, q, dp, dq, qi or oth are ignored: they are never read when parsing and never written by toJson.

    The certificate members x5c, x5t, x5t#S256 and x5u are ignored too: no certificate chain is read, validated or checked against the key, and they are never written by toJson.

    Keys are immutable values. Use the companion factories to construct them, named accessors to inspect them and withKeyId, withUse, withAlgorithm or withKeyOperations to update their metadata. They deliberately do not expose case-class copy, extractors or Product APIs, so that the model can evolve without changing those public signatures.

  4. final class JwkSet extends AnyRef

    An immutable JWK Set (RFC 7517 section 5).

  5. final class JwkThumbprint extends AnyRef

    A JWK thumbprint as defined by RFC 7638.

    A JWK thumbprint as defined by RFC 7638.

    The thumbprint is the digest itself: the hash octets of the canonical JSON form of the key. base64Url is its textual form (unpadded base64url), which is the value conventionally used as a JWT/JWK kid. uri is the RFC 9278 URI form.

    Only SHA-256 is supported at the moment. RFC 7638 permits other hash functions.

  6. sealed trait JwkUse extends AnyRef

    The intended use of a JWK, the use member (RFC 7517 section 4.2).

  7. class Jwt extends JwtCore[JwtHeader, JwtClaim]
  8. sealed trait JwtAlgorithm extends AnyRef
  9. class JwtArgonaut extends JwtArgonautParser[JwtHeader, JwtClaim]
  10. trait JwtArgonautParser[H, C] extends JwtJsonCommon[Json, H, C]
  11. class JwtCirce extends JwtCirceParser[JwtHeader, JwtClaim]
  12. trait JwtCirceParser[H, C] extends JwtJsonCommon[Json, H, C]

    Implementation of JwtCore using Json from Circe.

  13. class JwtClaim extends AnyRef
  14. 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

  15. class JwtHeader extends AnyRef
  16. class JwtJson extends JwtJsonParser[JwtHeader, JwtClaim]
  17. class JwtJson4s extends JwtJson4sParser[JwtHeader, JwtClaim]
  18. trait JwtJson4sImplicits extends AnyRef
  19. trait JwtJson4sParser[H, C] extends JwtJson4sCommon[H, C] with JwtJson4sImplicits

    Implementation of JwtCore using JObject from Json4s Native.

    Implementation of JwtCore using JObject from Json4s Native.

    To see a full list of samples, check the online documentation.

  20. trait JwtJsonImplicits extends AnyRef
  21. trait JwtJsonParser[H, C] extends JwtJsonCommon[JsObject, H, C] with JwtJsonImplicits

    Implementation of JwtCore using JsObject from Play JSON.

    Implementation of JwtCore using JsObject from Play JSON.

    To see a full list of samples, check the online documentation.

  22. case class JwtOptions(signature: Boolean = true, expiration: Boolean = true, notBefore: Boolean = true, leeway: Long = 0) extends Product with Serializable
  23. trait JwtPlayImplicits extends AnyRef
  24. 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 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.

  25. class JwtUpickle extends JwtUpickleParser[JwtHeader, JwtClaim]
  26. trait JwtUpickleImplicits extends AnyRef
  27. trait JwtUpickleParser[H, C] extends JwtJsonCommon[Value, H, C] with JwtUpickleImplicits

    Implementation of JwtCore using Js.Value from uPickle.

    Implementation of JwtCore using Js.Value from uPickle.

    To see a full list of samples, check the online documentation.

  28. class JwtZIOJson extends JwtZIOJsonParser[JwtHeader, JwtClaim]
  29. trait JwtZIOJsonParser[H, C] extends JwtJsonCommon[Json, H, C]
  30. sealed trait OkpCurve extends AnyRef

    A curve usable in an OKP JWK (RFC 8037 section 2).

    A curve usable in an OKP JWK (RFC 8037 section 2).

    Ed25519 and Ed448 are supported. Turning a key on these curves into a JDK PublicKey, and verifying signatures with it, requires a JDK that provides the EdDSA KeyFactory (JDK 15+). The other OKP curves, such as X25519 and X448, are not supported.

  31. final class OkpJwk extends Jwk

    An OKP JWK (RFC 8037) holding an Ed25519 or Ed448 public key.

    An OKP JWK (RFC 8037) holding an Ed25519 or Ed448 public key.

    Building the publicKey of such a key requires a JDK that provides the EdDSA KeyFactory, which is the case from JDK 15 on. See OkpCurve.

    Exceptions thrown

    JwtValidationException if x does not decode to curve.keyLength bytes

    java.lang.IllegalArgumentException if x is not valid base64url

  32. final class RsaJwk extends Jwk

Value Members

  1. object EcCurve
  2. object EcJwk
  3. object Jwk
  4. object JwkSet
  5. object JwkThumbprint
  6. object JwkUse
  7. 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 and nbf 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 return 1 instead of 1300819380. Sorry about that.

  8. object JwtAlgorithm
  9. object JwtArgonaut extends JwtArgonaut
  10. object JwtArrayUtils
  11. object JwtBase64
  12. object JwtCirce extends JwtCirce
  13. object JwtClaim
  14. object JwtHeader
  15. object JwtJson extends JwtJson
  16. object JwtJson4s extends JwtJson4s
  17. object JwtOptions extends Serializable
  18. object JwtSession extends JwtJsonImplicits with JwtPlayImplicits with Serializable
  19. object JwtTime

    Util object to handle time operations

  20. object JwtUpickle extends JwtUpickle
  21. object JwtUtils
  22. object JwtZIOJson extends JwtZIOJson
  23. object OkpCurve
  24. object OkpJwk
  25. object RsaJwk

Ungrouped