OpenmaizeJWT v1.0.0 OpenmaizeJWT.Config
This module provides an abstraction layer for configuration.
The following are valid configuration items.
name | type | default |
---|---|---|
signing_key | string | N/A |
token_alg | atom | :sha512 |
token_validity | int | 120 (minutes) |
token_data | list | %{} |
signing_key
must be set before using OpenmaizeJWT.
Examples
The simplest way to change the default values would be to add
an openmaize_jwt
entry to the config.exs
file in your project,
like the following example.
config :openmaize_jwt,
signing_key: "some random string"
token_alg: :sha256,
token_validity: 60,
token_data: %{iss: "www.example.com"},
Summary
Functions
The algorithm used to sign the token
The key used to sign the JSON Web Token
Additional information to be added to the token
The length of time after which a JSON Web Token expires
Functions
The algorithm used to sign the token.
The default value is :sha512, and :sha256 is also supported.
The key used to sign the JSON Web Token.
This can be generated by the OpenmaizeJWT.Tools.gen_key/1 function.
Additional information to be added to the token.
This is a map with atoms as keys. The default is an empty map.
Warning
Do not include any sensitive data in the JSON Web Token.