authable v0.10.0 Authable.Authentication behaviour

A behaviour for all authentications modules called by other authable modules.

Creating a custom module

If you are going to create a custom authentication module, then you need to implement following function:

  • authenticate

Link to this section Summary

Callbacks

Finds and returns Resource Owner(User) struct using a param(param can be any type)

Link to this section Callbacks

Link to this callback authenticate(any, atom)
authenticate(any(), List) :: {:ok, Authable.User} | {:error, Map, Atom}

Finds and returns Resource Owner(User) struct using a param(param can be any type).

This function returns a {:ok, Authable.Model.User struct} or {:error, Map, :http_status_code}.