From be5a7fa4e74d6ecdb512b7088cba41e7bb1848f4 Mon Sep 17 00:00:00 2001 From: Gaelle Braud Date: Fri, 23 Jan 2026 10:57:15 +0100 Subject: [PATCH] force starting timeout when oidc authentication requested so we can cancel the process in case the url isn't working --- Linphone/core/App.cpp | 7 ++--- Linphone/data/languages/de.ts | 50 +++++++++++++++---------------- Linphone/data/languages/en.ts | 50 +++++++++++++++---------------- Linphone/data/languages/fr.ts | 50 +++++++++++++++---------------- Linphone/model/auth/OIDCModel.cpp | 2 ++ Linphone/model/core/CoreModel.cpp | 3 ++ 6 files changed, 83 insertions(+), 79 deletions(-) diff --git a/Linphone/core/App.cpp b/Linphone/core/App.cpp index f82e89b33..65626f2bf 100644 --- a/Linphone/core/App.cpp +++ b/Linphone/core/App.cpp @@ -306,6 +306,9 @@ App::App(int &argc, char *argv[]) setWindowIcon(QIcon(Constants::WindowIconPath)); initFonts(); //------------------- + mOIDCRefreshTimer.setInterval(1000); + mOIDCRefreshTimer.setSingleShot(false); + mLinphoneThread = new Thread(this); init(); @@ -329,9 +332,6 @@ App::App(int &argc, char *argv[]) mEventCountNotifier = new EventCountNotifier(this); mDateUpdateTimer.start(); - mOIDCRefreshTimer.setInterval(1000); - mOIDCRefreshTimer.setSingleShot(false); - #ifdef Q_OS_LINUX exportDesktopFile(); #endif @@ -530,7 +530,6 @@ void App::setSelf(QSharedPointer(me)) { mCoreModelConnection->makeConnectToModel(&CoreModel::oidcRemainingTimeBeforeTimeoutChanged, [this](int remainingTime) { - qDebug() << "App: oidc timeout changed"; mCoreModelConnection->invokeToCore([this, remainingTime] { mRemainingTimeBeforeOidcTimeout = remainingTime; emit remainingTimeBeforeOidcTimeoutChanged(); diff --git a/Linphone/data/languages/de.ts b/Linphone/data/languages/de.ts index 2c668769d..4476b8ddc 100644 --- a/Linphone/data/languages/de.ts +++ b/Linphone/data/languages/de.ts @@ -682,14 +682,14 @@ - + info_popup_error_title Error Fehler - + info_popup_configuration_failed_message Remote provisioning failed : %1 Remote-Provisionierung fehlgeschlagen: %1 @@ -729,86 +729,86 @@ Ihre Version ist auf dem neuesten Stand - + configuration_error_detail not reachable nicht erreichbar - + application_description "A free and open source SIP video-phone." Ein kostenloses Open-Source SIP Video-Telefon. - + command_line_arg_order "Send an order to the application towards a command line" Kommandozeilen-Befehl an die Anwendung schicken - + command_line_option_show_help Zeige Hilfe - + command_line_option_show_app_version App-Version anzeigen - + command_line_option_config_to_fetch "Specify the linphone configuration file to be fetched. It will be merged with the current configuration." Abzurufende Linphone-Konfigurationsdatei angeben. Sie wird mit der aktuellen Konfiguration zusammengeführt. - + command_line_option_config_to_fetch_arg "URL, path or file" URL, Pfad oder Datei - + command_line_option_minimized Minimieren - + command_line_option_log_to_stdout Debug-Informationen auf der Standardausgabe ausgeben - + command_line_option_print_app_logs_only "Print only logs from the application" Nur Anwendungs-Logs ausgeben - + hide_action "Cacher" "Afficher" Ausblenden - + show_action Zeigen - + quit_action "Quitter" Beenden - + check_for_update Check for update Auf Updates prüfen - + mark_all_read_action Alle als gelesen markieren @@ -5106,7 +5106,7 @@ Ablauf: %1 - + oidc_authentication_timeout_message Timeout: Not authenticated Zeitüberschreitung: Nicht authentifiziert @@ -5172,42 +5172,42 @@ Ablauf: %1 Autorisierung über den Browser anfordern - + oidc_authentication_no_token_found_error Kein Token gefunden - + oidc_authentication_request_token_message Requesting access token Zugriffstoken wird angefordert - + oidc_authentication_refresh_token_message Refreshing access token Zugriffstoken wird aktualisiert - + oidc_authentication_request_authorization_message Requesting authorization Autorisierung wird angefordert - + oidc_authentication_request_temporary_credentials_message Requesting temporary credentials Temporäre Anmeldedaten werden angefordert - + oidc_authentication_no_auth_found_in_config_error No authorization endpoint found in OpenID configuration Kein Autorisierungs-Endpunkt in der OpenID-Konfiguration gefunden - + oidc_authentication_no_token_found_in_config_error No token endpoint found in OpenID configuration Kein Token-Endpunkt in der OpenID-Konfiguration gefunden diff --git a/Linphone/data/languages/en.ts b/Linphone/data/languages/en.ts index 01500ffda..06b9bf94c 100644 --- a/Linphone/data/languages/en.ts +++ b/Linphone/data/languages/en.ts @@ -663,14 +663,14 @@ - + info_popup_error_title Error Error - + info_popup_configuration_failed_message Remote provisioning failed : %1 Remote provisioning failed : %1 @@ -710,86 +710,86 @@ Up to date Your version is up to date - + configuration_error_detail not reachable not reachable - + application_description "A free and open source SIP video-phone." A free and open source SIP video-phone. - + command_line_arg_order "Send an order to the application towards a command line" Send an order to the application towards a command line - + command_line_option_show_help Show this help - + command_line_option_show_app_version Show app version - + command_line_option_config_to_fetch "Specify the linphone configuration file to be fetched. It will be merged with the current configuration." Specify the linphone configuration file to be fetched. It will be merged with the current configuration. - + command_line_option_config_to_fetch_arg "URL, path or file" URL, path or file - + command_line_option_minimized Minimize - + command_line_option_log_to_stdout Log to stdout some debug information while running - + command_line_option_print_app_logs_only "Print only logs from the application" Print only logs from the application - + hide_action "Cacher" "Afficher" Hide - + show_action Show - + quit_action "Quitter" Quit - + check_for_update Check for update Check for update - + mark_all_read_action Marquer tout comme lu @@ -4995,7 +4995,7 @@ Expiration : %1 - + oidc_authentication_timeout_message Timeout: Not authenticated Timeout: Not authenticated @@ -5061,42 +5061,42 @@ Expiration : %1 Requesting authorization from browser - + oidc_authentication_no_token_found_error No token found - + oidc_authentication_request_token_message Requesting access token Requesting access token - + oidc_authentication_refresh_token_message Refreshing access token Refreshing access token - + oidc_authentication_request_authorization_message Requesting authorization Requesting authorization - + oidc_authentication_request_temporary_credentials_message Requesting temporary credentials Requesting temporary credentials - + oidc_authentication_no_auth_found_in_config_error No authorization endpoint found in OpenID configuration No authorization endpoint found in OpenID configuration - + oidc_authentication_no_token_found_in_config_error No token endpoint found in OpenID configuration No token endpoint found in OpenID configuration diff --git a/Linphone/data/languages/fr.ts b/Linphone/data/languages/fr.ts index cd15a94d6..86aec6f51 100644 --- a/Linphone/data/languages/fr.ts +++ b/Linphone/data/languages/fr.ts @@ -658,14 +658,14 @@ - + info_popup_error_title Error Erreur - + info_popup_configuration_failed_message Remote provisioning failed : %1 La configuration distante a échoué : %1 @@ -705,86 +705,86 @@ Votre version est à jour - + configuration_error_detail not reachable indisponible - + application_description "A free and open source SIP video-phone." A free and open source SIP video-phone. - + command_line_arg_order "Send an order to the application towards a command line" Send an order to the application towards a command line - + command_line_option_show_help Show this help - + command_line_option_show_app_version Afficher la version de l'application - + command_line_option_config_to_fetch "Specify the linphone configuration file to be fetched. It will be merged with the current configuration." Specify the linphone configuration file to be fetched. It will be merged with the current configuration. - + command_line_option_config_to_fetch_arg "URL, path or file" URL, path or file - + command_line_option_minimized Minimiser - + command_line_option_log_to_stdout Log to stdout some debug information while running - + command_line_option_print_app_logs_only "Print only logs from the application" Print only logs from the application - + hide_action "Cacher" "Afficher" Cacher - + show_action Afficher - + quit_action "Quitter" Quitter - + check_for_update Check for update Rechercher une mise à jour - + mark_all_read_action Marquer tout comme lu @@ -4966,7 +4966,7 @@ Expiration : %1 - + oidc_authentication_timeout_message Timeout: Not authenticated Timeout : non authentifié @@ -5032,42 +5032,42 @@ Expiration : %1 En attente d'autorisation du navigateur - + oidc_authentication_no_token_found_error Token non trouvé - + oidc_authentication_request_token_message Requesting access token En attente du token d'accès - + oidc_authentication_refresh_token_message Refreshing access token Token en cours de rafraîchissement - + oidc_authentication_request_authorization_message Requesting authorization Autorisation en cours - + oidc_authentication_request_temporary_credentials_message Requesting temporary credentials En attente d'identifiants temporaires - + oidc_authentication_no_auth_found_in_config_error No authorization endpoint found in OpenID configuration Pas d'autorisation trouvé dans la configuration OpenID - + oidc_authentication_no_token_found_in_config_error No token endpoint found in OpenID configuration Pas de token trouvé dans la configuration OpenID diff --git a/Linphone/model/auth/OIDCModel.cpp b/Linphone/model/auth/OIDCModel.cpp index 79e8fc561..6659fe498 100644 --- a/Linphone/model/auth/OIDCModel.cpp +++ b/Linphone/model/auth/OIDCModel.cpp @@ -192,6 +192,8 @@ OIDCModel::OIDCModel(const std::shared_ptr &authInfo, QObjec emit timeoutTimerStarted(); QDesktopServices::openUrl(url); }); + mTimeout.start(); + emit timeoutTimerStarted(); connect(&mOidc, &QOAuth2AuthorizationCodeFlow::finished, [this](QNetworkReply *reply) { connect(reply, &QNetworkReply::errorOccurred, diff --git a/Linphone/model/core/CoreModel.cpp b/Linphone/model/core/CoreModel.cpp index e1b8f2899..5e75704d4 100644 --- a/Linphone/model/core/CoreModel.cpp +++ b/Linphone/model/core/CoreModel.cpp @@ -417,6 +417,9 @@ void CoreModel::onAuthenticationRequested(const std::shared_ptr emit timeoutTimerStarted(); qDebug() << "start refresh timer"; }); + if (oidcModel->isTimerRunning()) { + emit timeoutTimerStarted(); + } connect(oidcModel, &OIDCModel::timeoutTimerStopped, this, [this] { emit timeoutTimerStopped(); }); connect(this, &CoreModel::forceOidcTimeout, oidcModel, [this, oidcModel] { if (oidcModel->isTimerRunning()) {