Merge branch 'main' into feat/299_plz
This commit is contained in:
commit
c8d7dd3e55
36 changed files with 250 additions and 187 deletions
|
|
@ -2,7 +2,7 @@ defmodule Mv.OidcRoleSync do
|
|||
@moduledoc """
|
||||
Syncs user role from OIDC user_info (e.g. groups claim → Admin role).
|
||||
|
||||
Used after OIDC registration (register_with_rauthy) and on sign-in so that
|
||||
Used after OIDC registration (register_with_oidc) and on sign-in so that
|
||||
users in the configured admin group get the Admin role; others get Mitglied.
|
||||
Configure via OIDC_ADMIN_GROUP_NAME and OIDC_GROUPS_CLAIM (see OidcRoleSyncConfig).
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ defmodule Mv.Secrets do
|
|||
particularly for OIDC (Rauthy) authentication.
|
||||
|
||||
## Configuration Source
|
||||
Secrets are read from the `:rauthy` key in the application configuration,
|
||||
Secrets are read from the `:oidc` key in the application configuration,
|
||||
which is typically set in `config/runtime.exs` from environment variables:
|
||||
- `OIDC_CLIENT_ID`
|
||||
- `OIDC_CLIENT_SECRET`
|
||||
|
|
@ -21,7 +21,7 @@ defmodule Mv.Secrets do
|
|||
use AshAuthentication.Secret
|
||||
|
||||
def secret_for(
|
||||
[:authentication, :strategies, :rauthy, :client_id],
|
||||
[:authentication, :strategies, :oidc, :client_id],
|
||||
Mv.Accounts.User,
|
||||
_opts,
|
||||
_meth
|
||||
|
|
@ -30,7 +30,7 @@ defmodule Mv.Secrets do
|
|||
end
|
||||
|
||||
def secret_for(
|
||||
[:authentication, :strategies, :rauthy, :redirect_uri],
|
||||
[:authentication, :strategies, :oidc, :redirect_uri],
|
||||
Mv.Accounts.User,
|
||||
_opts,
|
||||
_meth
|
||||
|
|
@ -39,7 +39,7 @@ defmodule Mv.Secrets do
|
|||
end
|
||||
|
||||
def secret_for(
|
||||
[:authentication, :strategies, :rauthy, :client_secret],
|
||||
[:authentication, :strategies, :oidc, :client_secret],
|
||||
Mv.Accounts.User,
|
||||
_opts,
|
||||
_meth
|
||||
|
|
@ -48,7 +48,7 @@ defmodule Mv.Secrets do
|
|||
end
|
||||
|
||||
def secret_for(
|
||||
[:authentication, :strategies, :rauthy, :base_url],
|
||||
[:authentication, :strategies, :oidc, :base_url],
|
||||
Mv.Accounts.User,
|
||||
_opts,
|
||||
_meth
|
||||
|
|
@ -58,7 +58,7 @@ defmodule Mv.Secrets do
|
|||
|
||||
defp get_config(key) do
|
||||
:mv
|
||||
|> Application.fetch_env!(:rauthy)
|
||||
|> Application.fetch_env!(:oidc)
|
||||
|> Keyword.fetch!(key)
|
||||
|> then(&{:ok, &1})
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue