JwtUpickleParser

trait JwtUpickleParser[H, C] extends JwtJsonCommon[Value, H, C] with JwtUpickleImplicits

Implementation of JwtCore using Js.Value from uPickle.

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

trait JwtJsonCommon[Value, H, C]
trait JwtCore[H, C]
class Object
trait Matchable
class Any
object JwtUpickle.type

Value members

Concrete methods

protected def getAlgorithm(header: Value): Option[JwtAlgorithm]
protected def parse(value: String): Value
protected def stringify(value: Value): String

Inherited methods

def decode(token: String, key: PublicKey): Try[C]
Inherited from:
JwtCore
def decode(token: String, key: PublicKey, options: JwtOptions): Try[C]

Same as decodeAll but only return the claim

Same as decodeAll but only return the claim

Value parameters:
key

the key that will be used to check the token signature

token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Returns:

if successful, the claim of the token in its correct type

Inherited from:
JwtCore
def decode(token: String, key: PublicKey, algorithms: Seq[JwtAsymmetricAlgorithm]): Try[C]
Inherited from:
JwtCore
def decode(token: String, key: PublicKey, algorithms: Seq[JwtAsymmetricAlgorithm], options: JwtOptions): Try[C]

Same as decodeAll but only return the claim

Same as decodeAll but only return the claim

Value parameters:
algorithms

a list of possible algorithms that the token can use. See Security concerns for more infos.

key

the key that will be used to check the token signature

token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Returns:

if successful, the claim of the token in its correct type

Inherited from:
JwtCore
def decode(token: String, key: SecretKey): Try[C]
Inherited from:
JwtCore
def decode(token: String, key: SecretKey, options: JwtOptions): Try[C]

Same as decodeAll but only return the claim

Same as decodeAll but only return the claim

Value parameters:
key

the key that will be used to check the token signature

token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Returns:

if successful, the claim of the token in its correct type

Inherited from:
JwtCore
def decode(token: String, key: SecretKey, algorithms: Seq[JwtHmacAlgorithm]): Try[C]
Inherited from:
JwtCore
def decode(token: String, key: SecretKey, algorithms: Seq[JwtHmacAlgorithm], options: JwtOptions): Try[C]

Same as decodeAll but only return the claim

Same as decodeAll but only return the claim

Value parameters:
algorithms

a list of possible algorithms that the token can use. See Security concerns for more infos.

key

the key that will be used to check the token signature

token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Returns:

if successful, the claim of the token in its correct type

Inherited from:
JwtCore
def decode(token: String, key: String, algorithms: => Seq[JwtAsymmetricAlgorithm]): Try[C]
Inherited from:
JwtCore
def decode(token: String, key: String, algorithms: => Seq[JwtAsymmetricAlgorithm], options: JwtOptions): Try[C]

Same as decodeAll but only return the claim

Same as decodeAll but only return the claim

Value parameters:
algorithms

a list of possible algorithms that the token can use. See Security concerns for more infos.

key

the key that will be used to check the token signature

token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Returns:

if successful, the claim of the token in its correct type

Inherited from:
JwtCore
def decode(token: String, key: String, algorithms: Seq[JwtHmacAlgorithm]): Try[C]
Inherited from:
JwtCore
def decode(token: String, key: String, algorithms: Seq[JwtHmacAlgorithm], options: JwtOptions): Try[C]

Same as decodeAll but only return the claim

Same as decodeAll but only return the claim

Value parameters:
algorithms

a list of possible algorithms that the token can use. See Security concerns for more infos.

key

the key that will be used to check the token signature

token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Returns:

if successful, the claim of the token in its correct type

Inherited from:
JwtCore
def decode(token: String): Try[C]
Inherited from:
JwtCore
def decode(token: String, options: JwtOptions): Try[C]

Same as decodeAll but only return the claim

Same as decodeAll but only return the claim

Value parameters:
token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Returns:

if successful, the claim of the token in its correct type

Inherited from:
JwtCore
def decodeAll(token: String, key: PublicKey): Try[(H, C, String)]
Inherited from:
JwtCore
def decodeAll(token: String, key: PublicKey, options: JwtOptions): Try[(H, C, String)]

Same as decodeRawAll but return the real header and claim types

Same as decodeRawAll but return the real header and claim types

Value parameters:
key

the key that will be used to check the token signature

token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Returns:

if successful, a tuple representing the header, the claim and eventually the signature

Inherited from:
JwtCore
def decodeAll(token: String, key: PublicKey, algorithms: Seq[JwtAsymmetricAlgorithm]): Try[(H, C, String)]
Inherited from:
JwtCore
def decodeAll(token: String, key: PublicKey, algorithms: Seq[JwtAsymmetricAlgorithm], options: JwtOptions): Try[(H, C, String)]

Same as decodeRawAll but return the real header and claim types

Same as decodeRawAll but return the real header and claim types

Value parameters:
algorithms

a list of possible algorithms that the token can use. See Security concerns for more infos.

key

the key that will be used to check the token signature

token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Returns:

if successful, a tuple representing the header, the claim and eventually the signature

Inherited from:
JwtCore
def decodeAll(token: String, key: SecretKey): Try[(H, C, String)]
Inherited from:
JwtCore
def decodeAll(token: String, key: SecretKey, options: JwtOptions): Try[(H, C, String)]

Same as decodeRawAll but return the real header and claim types

Same as decodeRawAll but return the real header and claim types

Value parameters:
key

the key that will be used to check the token signature

token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Returns:

if successful, a tuple representing the header, the claim and eventually the signature

Inherited from:
JwtCore
def decodeAll(token: String, key: SecretKey, algorithms: Seq[JwtHmacAlgorithm]): Try[(H, C, String)]
Inherited from:
JwtCore
def decodeAll(token: String, key: SecretKey, algorithms: Seq[JwtHmacAlgorithm], options: JwtOptions): Try[(H, C, String)]

Same as decodeRawAll but return the real header and claim types

Same as decodeRawAll but return the real header and claim types

Value parameters:
algorithms

a list of possible algorithms that the token can use. See Security concerns for more infos.

key

the key that will be used to check the token signature

token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Returns:

if successful, a tuple representing the header, the claim and eventually the signature

Inherited from:
JwtCore
def decodeAll(token: String, key: String, algorithms: => Seq[JwtAsymmetricAlgorithm]): Try[(H, C, String)]
Inherited from:
JwtCore
def decodeAll(token: String, key: String, algorithms: => Seq[JwtAsymmetricAlgorithm], options: JwtOptions): Try[(H, C, String)]

Same as decodeRawAll but return the real header and claim types

Same as decodeRawAll but return the real header and claim types

Value parameters:
algorithms

a list of possible algorithms that the token can use. See Security concerns for more infos.

key

the key that will be used to check the token signature

token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Returns:

if successful, a tuple representing the header, the claim and eventually the signature

Inherited from:
JwtCore
def decodeAll(token: String, key: String, algorithms: Seq[JwtHmacAlgorithm]): Try[(H, C, String)]
Inherited from:
JwtCore
def decodeAll(token: String, key: String, algorithms: Seq[JwtHmacAlgorithm], options: JwtOptions): Try[(H, C, String)]

Same as decodeRawAll but return the real header and claim types

Same as decodeRawAll but return the real header and claim types

Value parameters:
algorithms

a list of possible algorithms that the token can use. See Security concerns for more infos.

key

the key that will be used to check the token signature

token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Returns:

if successful, a tuple representing the header, the claim and eventually the signature

Inherited from:
JwtCore
def decodeAll(token: String): Try[(H, C, String)]
Inherited from:
JwtCore
def decodeAll(token: String, options: JwtOptions): Try[(H, C, String)]

Same as decodeRawAll but return the real header and claim types

Same as decodeRawAll but return the real header and claim types

Value parameters:
token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Returns:

if successful, a tuple representing the header, the claim and eventually the signature

Inherited from:
JwtCore
def decodeJson(token: String, key: PublicKey): Try[Value]
Inherited from:
JwtJsonCommon
def decodeJson(token: String, key: PublicKey, options: JwtOptions): Try[Value]
Inherited from:
JwtJsonCommon
def decodeJson(token: String, key: PublicKey, algorithms: Seq[JwtAsymmetricAlgorithm]): Try[Value]
Inherited from:
JwtJsonCommon
def decodeJson(token: String, key: PublicKey, algorithms: Seq[JwtAsymmetricAlgorithm], options: JwtOptions): Try[Value]
Inherited from:
JwtJsonCommon
def decodeJson(token: String, key: SecretKey): Try[Value]
Inherited from:
JwtJsonCommon
def decodeJson(token: String, key: SecretKey, options: JwtOptions): Try[Value]
Inherited from:
JwtJsonCommon
def decodeJson(token: String, key: SecretKey, algorithms: Seq[JwtHmacAlgorithm]): Try[Value]
Inherited from:
JwtJsonCommon
def decodeJson(token: String, key: SecretKey, algorithms: Seq[JwtHmacAlgorithm], options: JwtOptions): Try[Value]
Inherited from:
JwtJsonCommon
def decodeJson(token: String, key: String, algorithms: => Seq[JwtAsymmetricAlgorithm]): Try[Value]
Inherited from:
JwtJsonCommon
def decodeJson(token: String, key: String, algorithms: => Seq[JwtAsymmetricAlgorithm], options: JwtOptions): Try[Value]
Inherited from:
JwtJsonCommon
def decodeJson(token: String, key: String, algorithms: Seq[JwtHmacAlgorithm]): Try[Value]
Inherited from:
JwtJsonCommon
def decodeJson(token: String, key: String, algorithms: Seq[JwtHmacAlgorithm], options: JwtOptions): Try[Value]
Inherited from:
JwtJsonCommon
def decodeJson(token: String): Try[Value]
Inherited from:
JwtJsonCommon
def decodeJson(token: String, options: JwtOptions): Try[Value]
Inherited from:
JwtJsonCommon
def decodeJsonAll(token: String, key: PublicKey): Try[(Value, Value, String)]
Inherited from:
JwtJsonCommon
def decodeJsonAll(token: String, key: PublicKey, options: JwtOptions): Try[(Value, Value, String)]
Inherited from:
JwtJsonCommon
def decodeJsonAll(token: String, key: PublicKey, algorithms: Seq[JwtAsymmetricAlgorithm]): Try[(Value, Value, String)]
Inherited from:
JwtJsonCommon
def decodeJsonAll(token: String, key: PublicKey, algorithms: Seq[JwtAsymmetricAlgorithm], options: JwtOptions): Try[(Value, Value, String)]
Inherited from:
JwtJsonCommon
def decodeJsonAll(token: String, key: SecretKey): Try[(Value, Value, String)]
Inherited from:
JwtJsonCommon
def decodeJsonAll(token: String, key: SecretKey, options: JwtOptions): Try[(Value, Value, String)]
Inherited from:
JwtJsonCommon
def decodeJsonAll(token: String, key: SecretKey, algorithms: Seq[JwtHmacAlgorithm]): Try[(Value, Value, String)]
Inherited from:
JwtJsonCommon
def decodeJsonAll(token: String, key: SecretKey, algorithms: Seq[JwtHmacAlgorithm], options: JwtOptions): Try[(Value, Value, String)]
Inherited from:
JwtJsonCommon
def decodeJsonAll(token: String, key: String, algorithms: => Seq[JwtAsymmetricAlgorithm]): Try[(Value, Value, String)]
Inherited from:
JwtJsonCommon
def decodeJsonAll(token: String, key: String, algorithms: => Seq[JwtAsymmetricAlgorithm], options: JwtOptions): Try[(Value, Value, String)]
Inherited from:
JwtJsonCommon
def decodeJsonAll(token: String, key: String, algorithms: Seq[JwtHmacAlgorithm]): Try[(Value, Value, String)]
Inherited from:
JwtJsonCommon
def decodeJsonAll(token: String, key: String, algorithms: Seq[JwtHmacAlgorithm], options: JwtOptions): Try[(Value, Value, String)]
Inherited from:
JwtJsonCommon
def decodeJsonAll(token: String): Try[(Value, Value, String)]
Inherited from:
JwtJsonCommon
def decodeJsonAll(token: String, options: JwtOptions): Try[(Value, Value, String)]
Inherited from:
JwtJsonCommon
def decodeRaw(token: String, key: PublicKey): Try[String]
Inherited from:
JwtCore
def decodeRaw(token: String, key: PublicKey, options: JwtOptions): Try[String]

Same as decodeRawAll but only return the claim (you only care about the claim most of the time)

Same as decodeRawAll but only return the claim (you only care about the claim most of the time)

Value parameters:
key

the key that will be used to check the token signature

token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Returns:

if successful, a string representing the JSON version of the claim

Inherited from:
JwtCore
def decodeRaw(token: String, key: PublicKey, algorithms: Seq[JwtAsymmetricAlgorithm]): Try[String]
Inherited from:
JwtCore
def decodeRaw(token: String, key: PublicKey, algorithms: Seq[JwtAsymmetricAlgorithm], options: JwtOptions): Try[String]

Same as decodeRawAll but only return the claim (you only care about the claim most of the time)

Same as decodeRawAll but only return the claim (you only care about the claim most of the time)

Value parameters:
algorithms

a list of possible algorithms that the token can use. See Security concerns for more infos.

key

the key that will be used to check the token signature

token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Returns:

if successful, a string representing the JSON version of the claim

Inherited from:
JwtCore
def decodeRaw(token: String, key: SecretKey): Try[String]
Inherited from:
JwtCore
def decodeRaw(token: String, key: SecretKey, options: JwtOptions): Try[String]

Same as decodeRawAll but only return the claim (you only care about the claim most of the time)

Same as decodeRawAll but only return the claim (you only care about the claim most of the time)

Value parameters:
key

the key that will be used to check the token signature

token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Returns:

if successful, a string representing the JSON version of the claim

Inherited from:
JwtCore
def decodeRaw(token: String, key: SecretKey, algorithms: Seq[JwtHmacAlgorithm]): Try[String]
Inherited from:
JwtCore
def decodeRaw(token: String, key: SecretKey, algorithms: Seq[JwtHmacAlgorithm], options: JwtOptions): Try[String]

Same as decodeRawAll but only return the claim (you only care about the claim most of the time)

Same as decodeRawAll but only return the claim (you only care about the claim most of the time)

Value parameters:
algorithms

a list of possible algorithms that the token can use. See Security concerns for more infos.

key

the key that will be used to check the token signature

token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Returns:

if successful, a string representing the JSON version of the claim

Inherited from:
JwtCore
def decodeRaw(token: String, key: String, algorithms: => Seq[JwtAsymmetricAlgorithm]): Try[String]
Inherited from:
JwtCore
def decodeRaw(token: String, key: String, algorithms: => Seq[JwtAsymmetricAlgorithm], options: JwtOptions): Try[String]

Same as decodeRawAll but only return the claim (you only care about the claim most of the time)

Same as decodeRawAll but only return the claim (you only care about the claim most of the time)

Value parameters:
algorithms

a list of possible algorithms that the token can use. See Security concerns for more infos.

key

the key that will be used to check the token signature

token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Returns:

if successful, a string representing the JSON version of the claim

Inherited from:
JwtCore
def decodeRaw(token: String, key: String, algorithms: Seq[JwtHmacAlgorithm]): Try[String]
Inherited from:
JwtCore
def decodeRaw(token: String, key: String, algorithms: Seq[JwtHmacAlgorithm], options: JwtOptions): Try[String]

Same as decodeRawAll but only return the claim (you only care about the claim most of the time)

Same as decodeRawAll but only return the claim (you only care about the claim most of the time)

Value parameters:
algorithms

a list of possible algorithms that the token can use. See Security concerns for more infos.

key

the key that will be used to check the token signature

token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Returns:

if successful, a string representing the JSON version of the claim

Inherited from:
JwtCore
def decodeRaw(token: String): Try[String]
Inherited from:
JwtCore
def decodeRaw(token: String, options: JwtOptions): Try[String]

Same as decodeRawAll but only return the claim (you only care about the claim most of the time)

Same as decodeRawAll but only return the claim (you only care about the claim most of the time)

Value parameters:
token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Returns:

if successful, a string representing the JSON version of the claim

Inherited from:
JwtCore
def decodeRawAll(token: String, key: PublicKey): Try[(String, String, String)]
Inherited from:
JwtCore
def decodeRawAll(token: String, key: PublicKey, options: JwtOptions): Try[(String, String, String)]
Inherited from:
JwtCore
def decodeRawAll(token: String, key: PublicKey, algorithms: Seq[JwtAsymmetricAlgorithm]): Try[(String, String, String)]
Inherited from:
JwtCore
def decodeRawAll(token: String, key: PublicKey, algorithms: Seq[JwtAsymmetricAlgorithm], options: JwtOptions): Try[(String, String, String)]

Will try to decode a JSON Web Token to raw strings using an asymmetric algorithm

Will try to decode a JSON Web Token to raw strings using an asymmetric algorithm

Value parameters:
algorithms

a list of possible algorithms that the token can use. See Security concerns for more infos.

key

the key that will be used to check the token signature

token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Returns:

if successful, a tuple of 3 strings, the header, the claim and the signature

Inherited from:
JwtCore
def decodeRawAll(token: String, key: SecretKey): Try[(String, String, String)]
Inherited from:
JwtCore
def decodeRawAll(token: String, key: SecretKey, options: JwtOptions): Try[(String, String, String)]
Inherited from:
JwtCore
def decodeRawAll(token: String, key: SecretKey, algorithms: Seq[JwtHmacAlgorithm]): Try[(String, String, String)]
Inherited from:
JwtCore
def decodeRawAll(token: String, key: SecretKey, algorithms: Seq[JwtHmacAlgorithm], options: JwtOptions): Try[(String, String, String)]

Will try to decode a JSON Web Token to raw strings using a HMAC algorithm

Will try to decode a JSON Web Token to raw strings using a HMAC algorithm

Value parameters:
algorithms

a list of possible algorithms that the token can use. See Security concerns for more infos.

key

the key that will be used to check the token signature

token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Returns:

if successful, a tuple of 3 strings, the header, the claim and the signature

Inherited from:
JwtCore
def decodeRawAll(token: String, key: String, algorithms: => Seq[JwtAsymmetricAlgorithm]): Try[(String, String, String)]
Inherited from:
JwtCore
def decodeRawAll(token: String, key: String, algorithms: => Seq[JwtAsymmetricAlgorithm], options: JwtOptions): Try[(String, String, String)]

Will try to decode a JSON Web Token to raw strings using an asymmetric algorithm

Will try to decode a JSON Web Token to raw strings using an asymmetric algorithm

Value parameters:
algorithms

a list of possible algorithms that the token can use. See Security concerns for more infos.

key

the key that will be used to check the token signature

token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Returns:

if successful, a tuple of 3 strings, the header, the claim and the signature

Inherited from:
JwtCore
def decodeRawAll(token: String, key: String, algorithms: Seq[JwtHmacAlgorithm]): Try[(String, String, String)]
Inherited from:
JwtCore
def decodeRawAll(token: String, key: String, algorithms: Seq[JwtHmacAlgorithm], options: JwtOptions): Try[(String, String, String)]

Will try to decode a JSON Web Token to raw strings using a HMAC algorithm

Will try to decode a JSON Web Token to raw strings using a HMAC algorithm

Value parameters:
algorithms

a list of possible algorithms that the token can use. See Security concerns for more infos.

key

the key that will be used to check the token signature

token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Returns:

if successful, a tuple of 3 strings, the header, the claim and the signature

Inherited from:
JwtCore
Inherited from:
JwtCore
def decodeRawAll(token: String, options: JwtOptions): Try[(String, String, String)]

Will try to decode a JSON Web Token to raw strings

Will try to decode a JSON Web Token to raw strings

Value parameters:
token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Returns:

if successful, a tuple of 3 strings, the header, the claim and the signature

Inherited from:
JwtCore
def encode(claim: Value, key: PrivateKey, algorithm: JwtAsymmetricAlgorithm): String
Inherited from:
JwtJsonCommon
def encode(claim: Value, key: SecretKey, algorithm: JwtHmacAlgorithm): String
Inherited from:
JwtJsonCommon
def encode(claim: Value, key: String, algorithm: JwtAlgorithm): String
Inherited from:
JwtJsonCommon
def encode(claim: Value): String
Inherited from:
JwtJsonCommon
def encode(header: Value, claim: Value, key: Key): String
Inherited from:
JwtJsonCommon
def encode(header: Value, claim: Value, key: String): String
Inherited from:
JwtJsonCommon
def encode(header: Value, claim: Value): String
Inherited from:
JwtJsonCommon
def encode(header: JwtHeader, claim: JwtClaim, key: Key): String

An alias of encode if you only want to pass a string as the key, the algorithm will be deduced from the header.

An alias of encode if you only want to pass a string as the key, the algorithm will be deduced from the header.

Value parameters:
claim

the claim to stringify as a JSON before encoding the token

header

the header to stringify as a JSON before encoding the token

key

the secret key to use to sign the token (note that the algorithm will be deduced from the header)

Returns:

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Inherited from:
JwtCore
def encode(header: JwtHeader, claim: JwtClaim, key: String): String

An alias of encode if you only want to pass a string as the key, the algorithm will be deduced from the header.

An alias of encode if you only want to pass a string as the key, the algorithm will be deduced from the header.

Value parameters:
claim

the claim to stringify as a JSON before encoding the token

header

the header to stringify as a JSON before encoding the token

key

the secret key to use to sign the token (note that the algorithm will be deduced from the header)

Returns:

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Inherited from:
JwtCore
def encode(header: JwtHeader, claim: JwtClaim): String

An alias to encode if you want to use case classes for the header and the claim rather than strings, they will just be stringified to JSON format.

An alias to encode if you want to use case classes for the header and the claim rather than strings, they will just be stringified to JSON format.

Value parameters:
claim

the claim to stringify as a JSON before encoding the token

header

the header to stringify as a JSON before encoding the token

Returns:

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Inherited from:
JwtCore
def encode(claim: JwtClaim, key: PrivateKey, algorithm: JwtAsymmetricAlgorithm): String

An alias to encode which will provide an automatically generated header and use the claim as a case class.

An alias to encode which will provide an automatically generated header and use the claim as a case class.

Value parameters:
algorithm

the algorithm to sign the token

claim

the claim of the JSON Web Token

key

the key that will be used to check the token signature

Returns:

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Inherited from:
JwtCore
def encode(claim: JwtClaim, key: SecretKey, algorithm: JwtHmacAlgorithm): String

An alias to encode which will provide an automatically generated header and use the claim as a case class.

An alias to encode which will provide an automatically generated header and use the claim as a case class.

Value parameters:
algorithm

the algorithm to sign the token

claim

the claim of the JSON Web Token

key

the key that will be used to check the token signature

Returns:

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Inherited from:
JwtCore
def encode(claim: JwtClaim, key: String, algorithm: JwtAlgorithm): String

An alias to encode which will provide an automatically generated header and use the claim as a case class.

An alias to encode which will provide an automatically generated header and use the claim as a case class.

Value parameters:
algorithm

the algorithm to sign the token

claim

the claim of the JSON Web Token

key

the key that will be used to check the token signature

Returns:

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Inherited from:
JwtCore
def encode(claim: JwtClaim): String

An alias to encode which will provide an automatically generated header and setting both key and algorithm to None.

An alias to encode which will provide an automatically generated header and setting both key and algorithm to None.

Value parameters:
claim

the claim of the JSON Web Token

Returns:

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Inherited from:
JwtCore
def encode(claim: String, key: PrivateKey, algorithm: JwtAsymmetricAlgorithm): String

An alias to encode which will provide an automatically generated header and allowing you to get rid of Option for the key and the algorithm.

An alias to encode which will provide an automatically generated header and allowing you to get rid of Option for the key and the algorithm.

Value parameters:
algorithm

the algorithm to sign the token

claim

a valid stringified JSON representing the claim of the token

key

the key that will be used to check the token signature

Returns:

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Inherited from:
JwtCore
def encode(claim: String, key: SecretKey, algorithm: JwtHmacAlgorithm): String

An alias to encode which will provide an automatically generated header and allowing you to get rid of Option for the key and the algorithm.

An alias to encode which will provide an automatically generated header and allowing you to get rid of Option for the key and the algorithm.

Value parameters:
algorithm

the algorithm to sign the token

claim

a valid stringified JSON representing the claim of the token

key

the key that will be used to check the token signature

Returns:

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Inherited from:
JwtCore
def encode(claim: String, key: String, algorithm: JwtAlgorithm): String

An alias to encode which will provide an automatically generated header and allowing you to get rid of Option for the key and the algorithm.

An alias to encode which will provide an automatically generated header and allowing you to get rid of Option for the key and the algorithm.

Value parameters:
algorithm

the algorithm to sign the token

claim

a valid stringified JSON representing the claim of the token

key

the key that will be used to check the token signature

Returns:

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Inherited from:
JwtCore
def encode(claim: String): String

An alias to encode which will provide an automatically generated header.

An alias to encode which will provide an automatically generated header.

Value parameters:
claim

a valid stringified JSON representing the claim of the token

Returns:

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Inherited from:
JwtCore
def encode(header: String, claim: String, key: PrivateKey, algorithm: JwtAsymmetricAlgorithm): String
Inherited from:
JwtCore
def encode(header: String, claim: String, key: SecretKey, algorithm: JwtHmacAlgorithm): String
Inherited from:
JwtCore
def encode(header: String, claim: String, key: String, algorithm: JwtAlgorithm): String

Encode a JSON Web Token from its different parts. Both the header and the claim will be encoded to Base64 url-safe, then a signature will be eventually generated from it if you did pass a key and an algorithm, and finally, those three parts will be merged as a single string, using dots as separator.

Encode a JSON Web Token from its different parts. Both the header and the claim will be encoded to Base64 url-safe, then a signature will be eventually generated from it if you did pass a key and an algorithm, and finally, those three parts will be merged as a single string, using dots as separator.

Value parameters:
algorithm

the algorithm to sign the token

claim

a valid stringified JSON representing the claim of the token

header

a valid stringified JSON representing the header of the token

key

the key that will be used to check the token signature

Returns:

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Inherited from:
JwtCore
def encode(header: String, claim: String): String
Inherited from:
JwtCore
Inherited from:
JwtJsonCommon
protected def extractAlgorithm(header: H): Option[JwtAlgorithm]
Inherited from:
JwtCore
protected def extractExpiration(claim: JwtClaim): Option[Long]
Inherited from:
JwtJsonCommon
protected def extractExpiration(claim: C): Option[Long]
Inherited from:
JwtCore
protected def extractNotBefore(claim: JwtClaim): Option[Long]
Inherited from:
JwtJsonCommon
protected def extractNotBefore(claim: C): Option[Long]
Inherited from:
JwtCore
def isValid(token: String, key: PublicKey): Boolean
Inherited from:
JwtCore
def isValid(token: String, key: PublicKey, options: JwtOptions): Boolean
Inherited from:
JwtCore
def isValid(token: String, key: PublicKey, algorithms: Seq[JwtAsymmetricAlgorithm]): Boolean
Inherited from:
JwtCore
def isValid(token: String, key: PublicKey, algorithms: Seq[JwtAsymmetricAlgorithm], options: JwtOptions): Boolean

An alias for isValid if you want to directly pass a string as the key

An alias for isValid if you want to directly pass a string as the key

Value parameters:
algorithms

a list of possible algorithms that the token can use. See Security concerns for more infos.

key

the key that will be used to check the token signature

token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Returns:

a boolean value indicating if the token is valid or not

Inherited from:
JwtCore
def isValid(token: String, key: SecretKey): Boolean
Inherited from:
JwtCore
def isValid(token: String, key: SecretKey, options: JwtOptions): Boolean
Inherited from:
JwtCore
def isValid(token: String, key: SecretKey, algorithms: Seq[JwtHmacAlgorithm]): Boolean
Inherited from:
JwtCore
def isValid(token: String, key: SecretKey, algorithms: Seq[JwtHmacAlgorithm], options: JwtOptions): Boolean

An alias for isValid if you want to directly pass a string as the key

An alias for isValid if you want to directly pass a string as the key

Value parameters:
algorithms

a list of possible algorithms that the token can use. See Security concerns for more infos.

key

the key that will be used to check the token signature

token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Returns:

a boolean value indicating if the token is valid or not

Inherited from:
JwtCore
def isValid(token: String, key: String, algorithms: => Seq[JwtAsymmetricAlgorithm]): Boolean
Inherited from:
JwtCore
def isValid(token: String, key: String, algorithms: => Seq[JwtAsymmetricAlgorithm], options: JwtOptions): Boolean

An alias for isValid if you want to directly pass a string as the key for asymmetric algorithms

An alias for isValid if you want to directly pass a string as the key for asymmetric algorithms

Value parameters:
algorithms

a list of possible algorithms that the token can use. See Security concerns for more infos.

key

the key that will be used to check the token signature

token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Returns:

a boolean value indicating if the token is valid or not

Inherited from:
JwtCore
def isValid(token: String, key: String, algorithms: Seq[JwtHmacAlgorithm]): Boolean
Inherited from:
JwtCore
def isValid(token: String, key: String, algorithms: Seq[JwtHmacAlgorithm], options: JwtOptions): Boolean

An alias for isValid if you want to directly pass a string as the key for HMAC algorithms

An alias for isValid if you want to directly pass a string as the key for HMAC algorithms

Value parameters:
algorithms

a list of possible algorithms that the token can use. See Security concerns for more infos.

key

the key that will be used to check the token signature

token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Returns:

a boolean value indicating if the token is valid or not

Inherited from:
JwtCore
def isValid(token: String): Boolean
Inherited from:
JwtCore
def isValid(token: String, options: JwtOptions): Boolean

Test if a token is valid. Doesn't throw any exception.

Test if a token is valid. Doesn't throw any exception.

Value parameters:
token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Returns:

a boolean value indicating if the token is valid or not

Inherited from:
JwtCore
protected def parseClaim(claim: String): C
Inherited from:
JwtCore
protected def parseHeader(header: String): H
Inherited from:
JwtCore
def validate(token: String, key: PublicKey): Unit
Inherited from:
JwtCore
def validate(token: String, key: PublicKey, options: JwtOptions): Unit
Inherited from:
JwtCore
def validate(token: String, key: PublicKey, algorithms: Seq[JwtAsymmetricAlgorithm]): Unit
Inherited from:
JwtCore
def validate(token: String, key: PublicKey, algorithms: Seq[JwtAsymmetricAlgorithm], options: JwtOptions): Unit

An alias of validate in case you want to directly pass a string key.

An alias of validate in case you want to directly pass a string key.

Value parameters:
algorithms

a list of possible algorithms that the token can use. See Security concerns for more infos.

key

the key that will be used to check the token signature

token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Throws:
IllegalArgumentException

couldn't decode the token since it's not a valid base64 string

JwtExpirationException

the token isn't valid anymore because its expiration attribute is in the past

JwtLengthException

the number of parts separated by dots is wrong

JwtNotBeforeException

the token isn't valid yet because its notBefore attribute is in the future

JwtValidationException

default validation exception

Inherited from:
JwtCore
def validate(token: String, key: SecretKey): Unit
Inherited from:
JwtCore
def validate(token: String, key: SecretKey, options: JwtOptions): Unit
Inherited from:
JwtCore
def validate(token: String, key: SecretKey, algorithms: Seq[JwtHmacAlgorithm]): Unit
Inherited from:
JwtCore
def validate(token: String, key: SecretKey, algorithms: Seq[JwtHmacAlgorithm], options: JwtOptions): Unit

An alias of validate in case you want to directly pass a string key.

An alias of validate in case you want to directly pass a string key.

Value parameters:
algorithms

a list of possible algorithms that the token can use. See Security concerns for more infos.

key

the key that will be used to check the token signature

token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Throws:
IllegalArgumentException

couldn't decode the token since it's not a valid base64 string

JwtExpirationException

the token isn't valid anymore because its expiration attribute is in the past

JwtLengthException

the number of parts separated by dots is wrong

JwtNotBeforeException

the token isn't valid yet because its notBefore attribute is in the future

JwtValidationException

default validation exception

Inherited from:
JwtCore
def validate(token: String, key: String, algorithms: => Seq[JwtAsymmetricAlgorithm]): Unit
Inherited from:
JwtCore
def validate(token: String, key: String, algorithms: => Seq[JwtAsymmetricAlgorithm], options: JwtOptions): Unit

An alias of validate in case you want to directly pass a string key for asymmetric algorithms.

An alias of validate in case you want to directly pass a string key for asymmetric algorithms.

Value parameters:
algorithms

a list of possible algorithms that the token can use. See Security concerns for more infos.

key

the key that will be used to check the token signature

token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Throws:
IllegalArgumentException

couldn't decode the token since it's not a valid base64 string

JwtExpirationException

the token isn't valid anymore because its expiration attribute is in the past

JwtLengthException

the number of parts separated by dots is wrong

JwtNotBeforeException

the token isn't valid yet because its notBefore attribute is in the future

JwtValidationException

default validation exception

Inherited from:
JwtCore
def validate(token: String, key: String, algorithms: Seq[JwtHmacAlgorithm]): Unit
Inherited from:
JwtCore
def validate(token: String, key: String, algorithms: Seq[JwtHmacAlgorithm], options: JwtOptions): Unit

An alias of validate in case you want to directly pass a string key for HMAC algorithms.

An alias of validate in case you want to directly pass a string key for HMAC algorithms.

Value parameters:
algorithms

a list of possible algorithms that the token can use. See Security concerns for more infos.

key

the key that will be used to check the token signature

token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Throws:
IllegalArgumentException

couldn't decode the token since it's not a valid base64 string

JwtExpirationException

the token isn't valid anymore because its expiration attribute is in the past

JwtLengthException

the number of parts separated by dots is wrong

JwtNotBeforeException

the token isn't valid yet because its notBefore attribute is in the future

JwtValidationException

default validation exception

Inherited from:
JwtCore
def validate(token: String): Unit
Inherited from:
JwtCore
def validate(token: String, options: JwtOptions): Unit

Valid a token: doesn't return anything but will thrown exceptions if there are any errors.

Valid a token: doesn't return anything but will thrown exceptions if there are any errors.

Value parameters:
token

a JSON Web Token as a Base64 url-safe encoded String which can be used inside an HTTP header

Throws:
IllegalArgumentException

couldn't decode the token since it's not a valid base64 string

JwtExpirationException

the token isn't valid anymore because its expiration attribute is in the past

JwtLengthException

the number of parts separated by dots is wrong

JwtNotBeforeException

the token isn't valid yet because its notBefore attribute is in the future

JwtValidationException

default validation exception

Inherited from:
JwtCore
protected def validate(header64: String, header: H, claim64: String, claim: C, signature: String, key: PublicKey, algorithms: Seq[JwtAsymmetricAlgorithm], options: JwtOptions): Unit
Inherited from:
JwtCore
protected def validate(header64: String, header: H, claim64: String, claim: C, signature: String, key: SecretKey, algorithms: Seq[JwtHmacAlgorithm], options: JwtOptions): Unit
Inherited from:
JwtCore
protected def validate(header64: String, header: H, claim64: String, claim: C, signature: String, key: String, algorithms: => Seq[JwtAsymmetricAlgorithm], options: JwtOptions): Unit
Inherited from:
JwtCore
protected def validate(header64: String, header: H, claim64: String, claim: C, signature: String, key: String, algorithms: Seq[JwtHmacAlgorithm], options: JwtOptions): Unit
Inherited from:
JwtCore
protected def validate(header64: String, header: H, claim64: String, claim: C, signature: String, options: JwtOptions, verify: (Array[Byte], Array[Byte], JwtAlgorithm) => Boolean): Unit
Inherited from:
JwtCore
protected def validate(header: H, claim: C, signature: String, options: JwtOptions): Unit
Inherited from:
JwtCore
Inherited from:
JwtCore
protected def validateHmacAlgorithm(algorithm: JwtHmacAlgorithm, algorithms: Seq[JwtHmacAlgorithm]): Boolean
Inherited from:
JwtCore
protected def validateTiming(claim: C, options: JwtOptions): Try[Unit]
Inherited from:
JwtCore

Implicits

Inherited implicits

implicit val jwtUpickleClaimReadWrite: ReadWriter[JwtClaim]
Inherited from:
JwtUpickleImplicits
implicit val jwtUpickleHeaderReadWrite: ReadWriter[JwtHeader]
Inherited from:
JwtUpickleImplicits