authority v0.1.0 Authority.Tokenization behaviour
A behaviour for converting resources (or credentials) into tokens.
Usage
defmodule MyApp.Accounts.Tokenization do
use Authority.Tokenization
@impl Authority.Tokenization
def tokenize(resource, purpose) do
# create a token for the resource
end
end
Link to this section Summary
Types
The purpose for the token
A resource to be converted into a token. Can be any type that makes sense for the application
A token. Can be any type that makes sense for your application
Callbacks
Creates a token, assuming the :any
purpose, representing a given resource
Create a token with a given purpose, representing a given resource. For example, you might convert credentials (email/password) into a token representing a user
Link to this section Types
The purpose for the token.
A resource to be converted into a token. Can be any type that makes sense for the application.
A token. Can be any type that makes sense for your application.
Link to this section Callbacks
Creates a token, assuming the :any
purpose, representing a given resource.
Create a token with a given purpose, representing a given resource. For example, you might convert credentials (email/password) into a token representing a user.