Skip to content

Fork of ktonon/elm-jsonwebtoken with custom header encoder.

License

Notifications You must be signed in to change notification settings

georgesboris/elm-jwt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A fork of ktonon/elm-jsonwebtoken with the changes below:

  • Adds the possibility of passing extra values to the JWT header.

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

Fork of ktonon/elm-jsonwebtoken with custom header encoder.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Elm 100.0%