PowAssent v0.1.0 PowAssent.Strategy.OAuth2.Base behaviour View Source
OAuth 2.0 strategy base.
Usage
defmodule MyApp.MyOAuth2Strategy do
use PowAssent.Strategy.OAuth2
def default_config(_config) do
[
site: "https://api.example.com",
user_url: "/authorization.json"
]
end
def normalize(_config, user) do
%{
"uid" => user["id"],
"name" => user["name"],
"email" => user["email"]
}
end
end
Link to this section Summary
Link to this section Functions
Link to this function
authorize_url(config, conn, strategy)
View Source
authorize_url(Keyword.t(), Plug.Conn.t(), module()) :: {:ok, %{conn: Plug.Conn.t(), state: binary(), url: binary()}}
Link to this function
callback(config, conn, params, strategy)
View Source
callback(Keyword.t(), Plug.Conn.t(), map(), module()) :: {:ok, %{conn: Plug.Conn.t(), user: map()}} | {:error, %{conn: Plug.Conn.t(), error: any()}}