AshAuthentication.Phoenix.Components.DynamicOidc (ash_authentication_phoenix v3.0.0-rc.6)

View Source

Renders a sign-in button per database-stored OIDC connection.

Unlike the static OAuth2 components, this one queries the strategy's connection_resource at render time (scoped by the current Ash tenant forwarded from the parent SignIn component) and renders one button per matched row. Connections without rows for the current tenant produce no buttons.

Each connection's display_name and icon_url (configurable via the oidc_connection do ... end DSL on the resource) drive the button label and icon. If display_name isn't set, the button falls back to the host portion of base_url. If icon_url isn't set, a generic OIDC icon is rendered.

Component hierarchy

This is the top-most strategy-specific component, nested below AshAuthentication.Phoenix.Components.SignIn.

Props

  • strategy — the dynamic_oidc strategy struct.
  • current_tenant — the Ash tenant to scope connection lookup by. Forwarded from SignIn. May be nil when not multitenant.
  • context — opaque action context forwarded from SignIn.
  • overrides — list of override modules.
  • gettext_fn — optional translation function.

Overrides

This component provides the following overrides:

  • :root_class - CSS classes for the root div element.
  • :link_class - CSS classes for each connection's a element.
  • :icon_class - CSS classes for the icon SVG / img.

See AshAuthentication.Phoenix.Overrides for more information.

Summary

Types

props()

@type props() :: %{
  :strategy => AshAuthentication.Strategy.t(),
  optional(:current_tenant) => any(),
  optional(:context) => map(),
  optional(:auth_routes_prefix) => String.t(),
  optional(:overrides) => [module()],
  optional(:gettext_fn) => {module(), atom()}
}