gandalf v0.2.0 Gandalf.GrantType behaviour

A behaviour for all grant type modules called by other gandalf modules.

Creating a custom module

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

  • authorize

Summary

Callbacks

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

Callbacks

authorize(any)
authorize(any) ::
  {:ok, Application.get_env(:gandalf, :token_store)} |
  {:error, Map, Atom}

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

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