View Source KeenAuth.AuthenticationController behaviour (KeenAuth v0.2.2)

Summary

Types

Link to this type

oauth_callback_response()

View Source
@type oauth_callback_response() :: %{
  user: KeenAuth.User.t() | map(),
  token: tokens_map()
}
@type tokens_map() :: %{
  optional(:access_token) => binary(),
  optional(:id_token) => binary(),
  optional(:refresh_token) => binary()
}

Callbacks

@callback callback(conn :: Plug.Conn.t(), any()) :: Plug.Conn.t()
@callback delete(conn :: Plug.Conn.t(), any()) :: Plug.Conn.t()
@callback new(conn :: Plug.Conn.t(), any()) :: Plug.Conn.t()

Functions

Link to this function

get_authorization_uri(conn, provider)

View Source
@spec get_authorization_uri(Plug.Conn.t(), atom()) ::
  {:ok, %{session_params: map(), url: binary()}}
Link to this function

make_callback_back(conn, provider, params, session_params \\ %{})

View Source
@spec make_callback_back(Plug.Conn.t(), atom(), map(), map()) ::
  {:ok, oauth_callback_response()}
Link to this function

map_user(conn, provider, user)

View Source
@spec map_user(Plug.Conn.t(), atom(), map()) :: KeenAuth.User.t()
Link to this function

maybe_put_redirect_to(conn, params)

View Source
@spec maybe_put_redirect_to(Plug.Conn.t(), map()) :: Plug.Conn.t()
Link to this function

process(conn, provider, mapped_user, oauth_result)

View Source
@spec process(Plug.Conn.t(), atom(), KeenAuth.User.t() | map(), any()) :: any()
Link to this function

store(conn, provider, mapped_user, oauth_response)

View Source
@spec store(
  Plug.Conn.t(),
  atom(),
  KeenAuth.User.t() | map(),
  oauth_callback_response()
) :: any()