diff --git a/bindings/matrix-sdk-ffi/src/client.rs b/bindings/matrix-sdk-ffi/src/client.rs index b47b91514..64e76d70b 100644 --- a/bindings/matrix-sdk-ffi/src/client.rs +++ b/bindings/matrix-sdk-ffi/src/client.rs @@ -328,7 +328,7 @@ impl Client { /// OpenID Connect and this `Client` was constructed using auto-discovery by /// setting the homeserver with [`ClientBuilder::server_name()`]. pub(crate) fn discovered_authentication_server(&self) -> Option { - self.inner.authentication_server_info().cloned() + self.inner.oidc().authentication_server_info().cloned() } /// The sliding sync proxy that is trusted by the homeserver. `None` when diff --git a/crates/matrix-sdk/src/authentication.rs b/crates/matrix-sdk/src/authentication.rs index dc4dd068c..f759a7819 100644 --- a/crates/matrix-sdk/src/authentication.rs +++ b/crates/matrix-sdk/src/authentication.rs @@ -23,6 +23,7 @@ use crate::oidc::{self, Oidc, OidcAuthData}; /// children. pub(crate) struct AuthCtx { /// The authentication server info discovered from the homeserver. + #[cfg_attr(not(feature = "experimental-oidc"), allow(dead_code))] pub(crate) authentication_server_info: Option, } diff --git a/crates/matrix-sdk/src/client/mod.rs b/crates/matrix-sdk/src/client/mod.rs index 8eb8aab0f..01a2c4e99 100644 --- a/crates/matrix-sdk/src/client/mod.rs +++ b/crates/matrix-sdk/src/client/mod.rs @@ -53,7 +53,6 @@ use ruma::{ device::{delete_devices, get_devices, update_device}, directory::{get_public_rooms, get_public_rooms_filtered}, discovery::{ - discover_homeserver::AuthenticationServerInfo, get_capabilities::{self, Capabilities}, get_supported_versions, }, @@ -371,18 +370,6 @@ impl Client { self.inner.homeserver.read().await.clone() } - /// The authentication server info discovered from the homeserver. - /// - /// This will only be set if the homeserver supports authenticating via - /// OpenID Connect ([MSC3861]) and this `Client` was constructed using - /// auto-discovery by setting the homeserver with - /// [`ClientBuilder::server_name()`]. - /// - /// [MSC3861]: https://github.com/matrix-org/matrix-spec-proposals/pull/3861 - pub fn authentication_server_info(&self) -> Option<&AuthenticationServerInfo> { - self.inner.auth_ctx.authentication_server_info.as_ref() - } - /// The sliding sync proxy that is trusted by the homeserver. #[cfg(feature = "experimental-sliding-sync")] pub fn sliding_sync_proxy(&self) -> Option { diff --git a/examples/oidc_cli/src/main.rs b/examples/oidc_cli/src/main.rs index d96d5653c..79ef1d94b 100644 --- a/examples/oidc_cli/src/main.rs +++ b/examples/oidc_cli/src/main.rs @@ -552,7 +552,7 @@ async fn build_client( // Check if the homeserver advertises an OIDC Provider with auto-discovery. // This can be bypassed by providing the issuer manually, but it should be the // most common case for public homeservers. - if let Some(issuer_info) = client.authentication_server_info().cloned() { + if let Some(issuer_info) = client.oidc().authentication_server_info().cloned() { println!("Found issuer: {}", issuer_info.issuer); let homeserver = client.homeserver().await.to_string();