Assent v0.1.8 Assent.Strategy.OAuth2.Base behaviour View Source
OAuth 2.0 strategy base.
Usage
defmodule MyApp.MyOAuth2Strategy do
use Assent.Strategy.OAuth2.Base
def default_config(_config) do
[
site: "https://api.example.com",
user_url: "/authorization.json"
]
end
@impl true
def normalize(_config, user) do
{:ok, %{
"sub" => user["id"],
"name" => user["name"],
"email" => user["email"]
}}
end
end