Fix cross-signing bootstrap by passing UIA password auth
The homeserver requires User-Interactive Authentication before accepting cross-signing keys. Pass the bot's password so bootstrap succeeds. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -136,8 +136,21 @@ pub async fn run_bot(
|
||||
slog!("[matrix-bot] Logged in as {bot_user_id} (device: {})", login_response.device_id);
|
||||
|
||||
// Bootstrap cross-signing keys for E2EE verification support.
|
||||
if let Err(e) = client.encryption().bootstrap_cross_signing(None).await {
|
||||
slog!("[matrix-bot] Cross-signing bootstrap note: {e}");
|
||||
// Pass the bot's password for UIA (User-Interactive Authentication) —
|
||||
// the homeserver requires proof of identity before accepting cross-signing keys.
|
||||
{
|
||||
use matrix_sdk::ruma::api::client::uiaa;
|
||||
let password_auth = uiaa::AuthData::Password(uiaa::Password::new(
|
||||
uiaa::UserIdentifier::UserIdOrLocalpart(config.username.clone()),
|
||||
config.password.clone(),
|
||||
));
|
||||
if let Err(e) = client
|
||||
.encryption()
|
||||
.bootstrap_cross_signing(Some(password_auth))
|
||||
.await
|
||||
{
|
||||
slog!("[matrix-bot] Cross-signing bootstrap note: {e}");
|
||||
}
|
||||
}
|
||||
|
||||
// Self-sign own device keys so other clients don't show
|
||||
|
||||
Reference in New Issue
Block a user