View Source Assent.Strategy.OIDC.Base behaviour (Assent v0.3.0)

OIDC OAuth 2.0 strategy base.

Usage

defmodule MyApp.MyOIDCStrategy do
  use Assent.Strategy.OIDC.Base

  def default_config(_config) do
    [
      base_url: "https://oidc.example.com"
    ]
  end

  def normalize(_config, user), do: {:ok, user}
end

Summary

Callbacks

default_config(t)

@callback default_config(Keyword.t()) :: Keyword.t()

fetch_user(t, map)

@callback fetch_user(Keyword.t(), map()) :: {:ok, map()} | {:error, term()}

normalize(t, map)

@callback normalize(Keyword.t(), map()) ::
  {:ok, map()} | {:ok, map(), map()} | {:error, term()}

Functions

authorize_url(config, strategy)

@spec authorize_url(Keyword.t(), module()) :: Assent.Strategy.OIDC.on_authorize_url()

callback(config, params, strategy)

@spec callback(Keyword.t(), map(), module()) :: Assent.Strategy.OIDC.on_callback()