This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
1.0.0 1.0.1
JSON Web Token encoder and decoder (JWT)
version 1.0.2
license MIT
native-modules False
elm-version 0.18.0 <= v < 0.19.0
Tag 1.0.2
Committed At 2017-08-27 18:47:01 UTC
zwilias/elm-utf-tools 1.0.0 <= v < 2.0.0 1.0.1
waratuman/elm-coder 2.0.0 <= v < 3.0.0 2.0.1
prozacchiwawa/elm-urlbase64 1.0.0 <= v < 2.0.0 1.0.1
ktonon/elm-word 2.0.0 <= v < 3.0.0 2.1.1
ktonon/elm-crypto 1.0.0 <= v < 2.0.0 1.1.1
elm-lang/core 5.1.1 <= v < 6.0.0 5.1.1
NoRedInk/elm-decode-pipeline 3.0.0 <= v < 4.0.0 3.0.1

Modules

README

elm-jsonwebtoken

elm-package CircleCI

JSON Web Token encoder and decoder.

import JsonWebToken as JWT exposing (hmacSha256)

JWT.encode hmacSha256 Json.Encode.string "secret" "some payload"
    |> JWT.decode Json.Decode.string "secret"
--> Ok "some payload"

JWT.encode hmacSha256 Json.Encode.int "secret" 123
    |> JWT.decode Json.Decode.int "wrong secret"
--> Err <| InvalidSecret 123

Currently supports HMAC digests using SHA224, SHA256, SHA384, and SHA512. If any other alg is used, then decode will fail with DecodeHeaderFailed String.