diff --git a/bindings/matrix-sdk-ffi/src/api.udl b/bindings/matrix-sdk-ffi/src/api.udl
index 80a24aa20..2c705695f 100644
--- a/bindings/matrix-sdk-ffi/src/api.udl
+++ b/bindings/matrix-sdk-ffi/src/api.udl
@@ -156,24 +156,23 @@ interface MediaSource {
[Error]
enum AuthenticationError {
- "ClientMissing",
- "Generic",
+ "ClientMissing",
+ "Generic",
+};
+
+interface HomeserverLoginDetails {
+ string url();
+ string? authentication_issuer();
+ boolean supports_password_login();
};
interface AuthenticationService {
constructor(string base_path);
- [Throws=AuthenticationError]
- string homeserver();
+ HomeserverLoginDetails? homeserver_details();
[Throws=AuthenticationError]
- string? authentication_issuer();
-
- [Throws=AuthenticationError]
- boolean supports_password_login();
-
- [Throws=AuthenticationError]
- void use_server(string server_name);
+ void configure_homeserver(string server_name);
[Throws=AuthenticationError]
Client login(string username, string password);
diff --git a/bindings/matrix-sdk-ffi/src/authentication_service.rs b/bindings/matrix-sdk-ffi/src/authentication_service.rs
index 7ed148d82..0c3df8f12 100644
--- a/bindings/matrix-sdk-ffi/src/authentication_service.rs
+++ b/bindings/matrix-sdk-ffi/src/authentication_service.rs
@@ -1,12 +1,14 @@
use std::sync::Arc;
+use futures_util::future::join3;
use parking_lot::RwLock;
-use super::{client::Client, client_builder::ClientBuilder};
+use super::{client::Client, client_builder::ClientBuilder, RUNTIME};
pub struct AuthenticationService {
base_path: String,
client: RwLock