nova_auth_oidc_plugin (nova_auth_oidc v0.1.3)

View Source

Nova plugin that protects routes by checking for an authenticated actor in the session. Uses nova_auth_actor for session storage, making it compatible with any auth strategy.

Usage

#{prefix => ~"/protected",
  plugins => [{pre_request, [{nova_auth_oidc_plugin, #{
      auth_mod => my_oidc_config,
      provider => authentik,
      on_unauthorized => {redirect, ~"/auth/authentik/login"}
  }}]}],
  routes => [...]}

Options

  • auth_mod -- OIDC config module (used to build login redirect URL)
  • provider -- provider atom for redirect URL construction
  • on_unauthorized -- action when no actor session exists:
    • {redirect, Url} -- redirect to login
    • {status, Code} -- return HTTP status (e.g., 401)

Summary

Functions

plugin_info()

-spec plugin_info() -> map().

post_request(Req, Env, Options, State)

-spec post_request(map(), term(), map(), term()) -> term().

pre_request(Req, Env, Options, State)

-spec pre_request(map(), term(), map(), term()) -> term().