feat(oidc): add oidc method in OXICLOUD_AUTH_METHODS

permit an admin to specify `oidc` only as the only method to login/register
note that if OIDC is enabled, the engine always append oidc in OXICLOUD_AUTH_METHODS
we could move to an explicit declaration in a major release
This commit is contained in:
Edouard Vanbelle
2026-08-03 00:11:49 +02:00
parent 02db85c040
commit b91f2fab2b
6 changed files with 144 additions and 60 deletions
+7 -2
View File
@@ -532,13 +532,18 @@ async fn run() -> Result<(), Box<dyn std::error::Error>> {
.auth
.allowed_auth_methods
.contains(&common::config::AuthMethod::Password)
&& !config
.auth
.allowed_auth_methods
.contains(&common::config::AuthMethod::Oidc)
&& !config.smtp.is_enabled()
{
panic!(
"FATAL: OXICLOUD_AUTH_METHODS enables `magic_link` as the ONLY \
self-service auth method, but no SMTP transport is configured. \
Set OXICLOUD_SMTP_HOST (and matching OXICLOUD_SMTP_* settings) \
or add `password` to OXICLOUD_AUTH_METHODS. Refusing to start."
Set OXICLOUD_SMTP_HOST (and matching OXICLOUD_SMTP_* settings), \
add `password` or `oidc` to OXICLOUD_AUTH_METHODS, or drop \
`magic_link` from the list. Refusing to start."
);
}