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

OIDC OAuth 2.0 strategy base.

Usage

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

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

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

Link to this section Summary

Link to this section Callbacks

Specs

default_config(Keyword.t()) :: Keyword.t()

Specs

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

Specs

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

Link to this section Functions

Link to this function

authorize_url(config, strategy)

View Source

Specs

authorize_url(Keyword.t(), module()) ::
  {:ok,
   %{
     session_params: %{state: binary()} | %{state: binary(), nonce: binary()},
     url: binary()
   }}
  | {:error, term()}
Link to this function

callback(config, params, strategy)

View Source

Specs

callback(Keyword.t(), map(), module()) ::
  {:ok, %{user: map(), token: map()}} | {:error, term()}