From 6626a0d1a17c85f5a770d59baa557efe7fdd717f Mon Sep 17 00:00:00 2001 From: Benoit Martins Date: Fri, 25 Jul 2025 11:52:12 +0200 Subject: [PATCH] Fix setup du SingleSignOnManager --- Linphone/Core/CoreContext.swift | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Linphone/Core/CoreContext.swift b/Linphone/Core/CoreContext.swift index bba71f71f..cbe05f92f 100644 --- a/Linphone/Core/CoreContext.swift +++ b/Linphone/Core/CoreContext.swift @@ -254,20 +254,20 @@ class CoreContext: ObservableObject { } } }, onAuthenticationRequested: { (core: Core, authInfo: AuthInfo, method: AuthMethod) in - guard let username = authInfo.username, let domain = authInfo.domain, let realm = authInfo.realm else { - Log.error("Authentication requested but either username [\(String(describing: authInfo.username))], domain [\(String(describing: authInfo.domain))] or server [\(String(describing: authInfo.authorizationServer))] is nil or empty!") - return - } - if method == .Bearer { if let server = authInfo.authorizationServer, !server.isEmpty { - Log.info("Authentication requested method is Bearer, starting Single Sign On activity with server URL \(server) and username \(username)") + Log.info("Authentication requested method is Bearer, starting Single Sign On activity with server URL \(server) and username \(authInfo.username ?? "")") self.bearerAuthInfoPendingPasswordUpdate = authInfo - SingleSignOnManager.shared.setUp(ssoUrl: server, user: username) + SingleSignOnManager.shared.setUp(ssoUrl: server, user: authInfo.username ?? "") } } if method == .HttpDigest { + guard let username = authInfo.username, let domain = authInfo.domain, let realm = authInfo.realm else { + Log.error("Authentication requested but either username [\(String(describing: authInfo.username))], domain [\(String(describing: authInfo.domain))] or server [\(String(describing: authInfo.authorizationServer))] is nil or empty!") + return + } + guard let accountFound = core.accountList.first(where: { $0.params?.identityAddress?.username == authInfo.username && $0.params?.identityAddress?.domain == authInfo.domain