This commit is contained in:
parent
a8d9fe6121
commit
9b4f3b140c
19 changed files with 330 additions and 43 deletions
16
lib/mv/authorization/checks/oidc_only_active.ex
Normal file
16
lib/mv/authorization/checks/oidc_only_active.ex
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
defmodule Mv.Authorization.Checks.OidcOnlyActive do
|
||||
@moduledoc """
|
||||
Policy check: true when OIDC-only mode is active (Config.oidc_only?()).
|
||||
|
||||
Used to forbid password sign-in when only OIDC (SSO) sign-in is allowed.
|
||||
"""
|
||||
use Ash.Policy.SimpleCheck
|
||||
|
||||
alias Mv.Config
|
||||
|
||||
@impl true
|
||||
def describe(_opts), do: "OIDC-only mode is active"
|
||||
|
||||
@impl true
|
||||
def match?(_actor, _context, _opts), do: Config.oidc_only?()
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue