Skip to content

ktonon/elm-jsonwebtoken

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

JSON Web Token encoder and decoder

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages