diff options
-rw-r--r-- | officecfg/registry/schema/org/openoffice/Office/Common.xcs | 8 | ||||
-rw-r--r-- | uui/source/passwordcontainer.cxx | 16 |
2 files changed, 19 insertions, 5 deletions
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index 367d45d676d9..36c0b5f97fe1 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -928,6 +928,14 @@ credentials of the user.</desc> </info> </prop> + <prop oor:name="TrySystemCredentialsFirst" oor:type="xs:boolean" oor:nillable="false"> + <info> + <desc>Specifies if authentication using system credentials should be tried + automatically for all resources that support it (regardless of whether they are + in "AuthenticateUsingSystemCredentials" list or not).</desc> + </info> + <value>false</value> + </prop> </group> <group oor:name="Dictionaries"> <info> diff --git a/uui/source/passwordcontainer.cxx b/uui/source/passwordcontainer.cxx index c0639c269cfa..1c46f3ef1a2d 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, |