hansallis/elm-jwt/1.2.0

JWT

JWT

type JWT
= JWS JWS

A JSON Web Token.

Can be either a JWS (signed) or a JWE (encrypted). The latter is not yet implemented.

= TokenTypeUnknown
| JWSError DecodeError

A structured error describing exactly how the decoder failed.

fromString : String -> Result DecodeError JWT

Decode a JWT from string.

fromString "eyJhbGciOi..." == Ok ...
fromString "" == Err ...
fromString "definitelyNotAJWT" == Err ...

Verification

= NotYetValid
| Expired
| NotYetIssued

Error specific to time constraints in the claimset

= JWSVerificationError VerificationError

A structured error describing all verification errors.

Check if a verification error relates to the time constraints in the claimset.

VerifyOptions
-> String
-> Posix
-> JWT
-> Result VerificationError Bool

Check if the token is valid.

VerifyOptions
-> String
-> JWT
-> Task Never (Result VerificationError Bool)

A task to check if the token is valid.