joken v1.0.0 Joken.Signer
Signer is the JWK (JSON Web Key) and JWS (JSON Web Signature) configuration of Joken.
JWK is used by JWS to generate a token signature that is appended to the end of the token compact representation.
Joken uses https://hex.pm/packages/jose to do signing and verification.
Note: By default, the ‘none’ algorithm is disabled. To enable it, set the ‘allow_none_algorithm’ key on the ‘joken’ app configuration to true
Summary
Functions
Convenience for generating an ES* Joken.Signer
Convenience for generating an HS* Joken.Signer
Convenience for generating a Joken.Signer with the none algorithm
Returns the token payload without validating or verifying
Convenience for generating an PS* Joken.Signer
Convenience for generating an RS* Joken.Signer
Signs a payload (JOSE header + claims) with the configured signer
Signs a payload (JOSE header + claims) with the given signer
Verifies a token signature and decodes its payload. This assumes a signer was configured. It raises if there was none
Types
Functions
Specs
hs(binary, binary) :: Joken.Signer.t
Convenience for generating an HS* Joken.Signer
Specs
none(binary) :: Joken.Signer.t
Convenience for generating a Joken.Signer with the none algorithm
Specs
peek(Joken.Token.t, Keyword.t) :: Joken.Token.t
Returns the token payload without validating or verifying
Specs
sign(Joken.Token.t) :: Joken.Token.t
Signs a payload (JOSE header + claims) with the configured signer.
It raises ArgumentError if no signer was configured.
Specs
sign(Joken.Token.t, Joken.Signer.t) :: Joken.Token.t
Signs a payload (JOSE header + claims) with the given signer.
This will override the configured signer.
Specs
verify(Joken.Token.t, Joken.Signer.t | nil, Keyword.t) :: Joken.Token.t
Verifies a token signature and decodes its payload. This assumes a signer was configured. It raises if there was none.