Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marianoguerra/jwt-erl
JSON Web Token implementation in Erlang
https://github.com/marianoguerra/jwt-erl
Last synced: 7 days ago
JSON representation
JSON Web Token implementation in Erlang
- Host: GitHub
- URL: https://github.com/marianoguerra/jwt-erl
- Owner: marianoguerra
- Created: 2014-09-12T17:27:21.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2021-10-22T08:43:00.000Z (about 3 years ago)
- Last Synced: 2024-11-01T00:31:56.911Z (14 days ago)
- Language: Erlang
- Size: 62.5 KB
- Stars: 30
- Watchers: 7
- Forks: 11
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
JWT.erl
=======An Erlang implementation of `JSON Web Token draft 01 `_
Usage
-----::
{ok, Jwt} = jwt:encode(Algorithm, [{name, <<"bob">>}, {age, 29}], <<"secret">>)
Additional headers may also be specified::
{ok, Jwt} = jwt:encode(Algorithm, [{name, <<"bob">>}, {age, 29}], <<"secret">>, [{jti, <<"myid">>}])
where algorithm is one of the atoms:
* hs256
* hs384
* hs512Note the resulting JWT will not be encrypted, but verifiable with a secret key::
{ok, Decoded} = jwt:decode(Jwt, <<"secret">>)
Decoded is a record defined in include/jwt.hrl, you may be interested in
the body field which contains the raw decoded body.Algorithms
----------The JWT spec supports several algorithms for cryptographic signing. This library
currently supports:* HS256 - HMAC using SHA-256 hash algorithm
* HS384 - HMAC using SHA-384 hash algorithm
* HS512 - HMAC using SHA-512 hash algorithmTests
-----::
make tests
When changing dependencies
--------------------------::
make rebar.config
License
-------MIT