impl MSC2965: self-advertise as OIDC authentication provider

MSC2965 proposes to let the homeserver advertise its current OIDC authentication
issuer. These changes let conduwuit advertise itself as the issuer when
[global.auth.enable_oidc_login] is set. It also advertises its account management
endpoint if [global.auth.enable_oidc_account_management] is set.

None of these endpoints are implemented. This commit only implements the bare
advertisement, as requested by the MSC.
This commit is contained in:
lafleur authored and Ginger committed 2025-11-11 11:34:26 -05:00
1 parent 9a5ba6171f
commit be4ccbc11b
9 files changed
+157 -3

No files matched your search

+11
View File
@@ -289,6 +289,17 @@ pub fn check(config: &Config) -> Result {
));
}
if let Some(auth) = &config.auth {
if auth.enable_oidc_login {
if config.well_known.client.is_none() {
return Err!(Config(
"auth.enable_oidc_login",
"Oidc authentication is enabled but the well-known client is not set."
))
}
}
}
Ok(())
}
+17 -1
View File
@@ -104,7 +104,9 @@ pub struct Config {
#[serde(default)]
pub tls: TlsConfig,
/// The UNIX socket continuwuity will listen on.
pub auth: Option<AuthConfig>,
/// The UNIX socket conduwuit will listen on.
///
/// continuwuity cannot listen on both an IP address and a UNIX socket. If
/// listening on a UNIX socket, you MUST remove/comment the `address` key.
@@ -2020,6 +2022,20 @@ pub struct TlsConfig {
pub dual_protocol: bool,
}
#[derive(Clone, Debug, Deserialize, Default)]
#[config_example_generator(filename = "conduwuit-example.toml", section = "global.auth")]
pub struct AuthConfig {
/// Use this homeserver as the OIDC authentication reference.
/// Note that the legacy Matrix authentication still will work.
/// Unset by default.
pub enable_oidc_login: bool,
/// The URL where the user is able to access the account management
/// capabilities of the homeserver. Only used if `enable_oidc_login` is set.
/// Unset by default.
pub enable_oidc_account_management: bool,
}
#[allow(rustdoc::broken_intra_doc_links, rustdoc::bare_urls)]
#[derive(Clone, Debug, Deserialize, Default)]
#[config_example_generator(filename = "conduwuit-example.toml", section = "global.well_known")]