summaryrefslogtreecommitdiff
path: root/uui
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2017-05-05 18:34:36 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2017-05-06 06:59:58 +0200
commit4bf7cf2440e7d85baa365638858ec13aa534e2ba (patch)
tree193898d929e23e7ccf800af4f48592ae64fa221d /uui
parent87cc61449023e0675ea8ef456c567fb357a340f3 (diff)
tdf#107649: add TrySystemCredentialsFirst config option
This will allow automatically try system credentials for any URI (including unknown) before displaying dialogs. This is intended for corporate enviromnents. Default value of this option is false, keeping current behavior. Change-Id: I96cb18e089134325e1f92f1afdef331975000e3b Reviewed-on: https://gerrit.libreoffice.org/37297 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Andras Timar <andras.timar@collabora.com> (cherry picked from commit ffd8e6b44e7dacb28047661fd6b73061790761cf) Reviewed-on: https://gerrit.libreoffice.org/37303 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'uui')
-rw-r--r--uui/source/passwordcontainer.cxx16
1 files changed, 11 insertions, 5 deletions
diff --git a/uui/source/passwordcontainer.cxx b/uui/source/passwordcontainer.cxx
index e724fbb03441..00cd9d05584b 100644
--- a/uui/source/passwordcontainer.cxx
+++ b/uui/source/passwordcontainer.cxx
@@ -30,6 +30,7 @@
#include <com/sun/star/ucb/URLAuthenticationRequest.hpp>
#include <com/sun/star/ucb/XInteractionSupplyAuthentication.hpp>
#include <com/sun/star/ucb/XInteractionSupplyAuthentication2.hpp>
+#include "officecfg/Office/Common.hxx"
#include "passwordcontainer.hxx"
@@ -142,11 +143,16 @@ bool PasswordContainerHelper::handleAuthenticationRequest(
if ( bCanUseSystemCredentials )
{
- // Runtime / Persistent info avail for current auth request?
-
- OUString aResult = m_xPasswordContainer->findUrl(
- rURL.isEmpty() ? rRequest.ServerName : rURL );
- if ( !aResult.isEmpty() )
+ // Does the configuration mandate that we try system credentials first?
+ bool bUseSystemCredentials = ::officecfg::Office::Common::Passwords::TrySystemCredentialsFirst::get();
+ if (!bUseSystemCredentials)
+ {
+ // Runtime / Persistent info avail for current auth request?
+ OUString aResult = m_xPasswordContainer->findUrl(
+ rURL.isEmpty() ? rRequest.ServerName : rURL);
+ bUseSystemCredentials = !aResult.isEmpty();
+ }
+ if ( bUseSystemCredentials )
{
if ( fillContinuation( true,
rRequest,