nova_auth_oidc behaviour (nova_auth_oidc v0.1.3)
View SourceBehaviour for OIDC authentication configuration. Implementing modules define OIDC providers, scopes, and callbacks. Configuration is cached in persistent_term for fast repeated access.
Example
-module(my_oidc_config).
-behaviour(nova_auth_oidc).
-export([config/0]).
config() ->
#{providers => #{
authentik => #{
issuer => ~"https://auth.example.com/application/o/myapp",
client_id => os:getenv("AUTHENTIK_CLIENT_ID"),
client_secret => os:getenv("AUTHENTIK_CLIENT_SECRET")
}
},
base_url => ~"https://myapp.example.com",
claims_mapping => #{
~"sub" => id,
~"email" => email,
~"groups" => roles
}}.
Summary
Functions
Return the merged OIDC configuration for Mod, caching in persistent_term.
Return a single config value for Key from the OIDC module Mod.
Start all provider configuration workers for the given auth module.
Call this from your application's start/2. Idempotent.
Evict the cached configuration for Mod from persistent_term.
Return configuration for a specific provider.
Return the registered name for a provider's configuration worker.
Build the callback redirect URI for a provider.
Types
Callbacks
Functions
Return the merged OIDC configuration for Mod, caching in persistent_term.
Return a single config value for Key from the OIDC module Mod.
-spec ensure_providers(module()) -> ok.
Start all provider configuration workers for the given auth module.
Call this from your application's start/2. Idempotent.
Evict the cached configuration for Mod from persistent_term.
-spec provider_config(module(), atom()) -> {ok, provider_config()} | {error, not_found}.
Return configuration for a specific provider.
Return the registered name for a provider's configuration worker.
Build the callback redirect URI for a provider.