Guardian v1.0.0-beta.0 Guardian.Token behaviour View Source
The behaviour module for all token modules.
Token modules are responsible for all the heavy lifting in Guardian.
Link to this section Summary
Callbacks
Build the default claims for the token
Create the token including serializing and signing
Decode the token. Without verification of the claims within it
Exchange a token from one type to another
Inspect the contents of the token without validation or signature checking
Refresh a token
Revoke a token (if appropriate)
Generate a unique id for a token
Verify the claims of a token
Link to this section Types
ttl :: {pos_integer, :second} | {pos_integer, :seconds} | {pos_integer, :minute} | {pos_integer, :minutes} | {pos_integer, :day} | {pos_integer, :days} | {pos_integer, :week} | {pos_integer, :weeks}
Link to this section Callbacks
Build the default claims for the token
create_token(mod :: module, claims :: claims, options :: Guardian.options) :: {:ok, token} | signing_error | secret_error | encoding_error
Create the token including serializing and signing
decode_token(mod :: module, token :: token, options :: Guadian.options) :: {:ok, token} | secret_error | decoding_error
Decode the token. Without verification of the claims within it.
Exchange a token from one type to another
Inspect the contents of the token without validation or signature checking
Refresh a token
revoke(mod :: module, claims :: claims, token :: token, options :: Guardian.options) :: {:ok, claims | {:error, any}}
Revoke a token (if appropriate)
Generate a unique id for a token
verify_claims(mod :: module, claims :: claims, options :: Guardian.options) :: {:ok, claims} | {:error, any}
Verify the claims of a token