Coherence v0.3.0 Coherence.Authentication.Token
Implements token based authentication. To use add
plug Coherence.Authentication.Token, source: :params, param: "auth_token"
or
plug Coherence.Authentication.Token, source: :session, param: "auth_token"
or
plug Coherence.Authentication.Token, source: :header, param: "X-Auth-Token"
or
plug Coherence.Authentication.Token, source: { module, function, ["my_param"]} end
or
plug Coherence.Authentication.Token, source: :params_session, param: "auth_token"
to your pipeline.
Options
source
- where to locate the tokenerror
- The error message if not authenticatedassigns_key
- The key to user in assigns (:current_uer)store
- Where to store the token data
Summary
Functions
Add the credentials for a token
. user_data
can be any term but must not be nil
Utility function to generate a random authentication token
Remove the credentials for a token
Functions
Add the credentials for a token
. user_data
can be any term but must not be nil
.
Remove the credentials for a token
.