PlugAuth.Authentication.Token
Implements token based authentication. To use add
plug PlugAuth.Authentication.Token, source: :params, param: "auth_token"
or
plug PlugAuth.Authentication.Token, source: :session, param: "auth_token"
or
plug PlugAuth.Authentication.Token, source: :header, param: "X-Auth-Token"
or
plug PlugAuth.Authentication.Token, source: { module, function, ["my_param"]} end
to your pipeline.
Summary↑
call(conn, opts) | Callback implementation for |
generate_token() | Utility function to generate a random authentication token |
get_token_from_header(conn, param) | |
get_token_from_params(conn, param) | |
get_token_from_session(conn, param) | |
init(opts) | Callback implementation for |
Functions
Callback implementation for c:Plug.call/2
.
Utility function to generate a random authentication token.
Callback implementation for c:Plug.init/1
.