summaryrefslogtreecommitdiff
path: root/ucbhelper/source/provider/simpleauthenticationrequest.cxx
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2009-09-17 14:41:33 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2009-09-17 14:41:33 +0000
commit84a850128d4dc3dc0d9fad53ac611fe3a9832c8f (patch)
tree9555291299d40db5301db2bd106c3cb5ef8c7d19 /ucbhelper/source/provider/simpleauthenticationrequest.cxx
parent85d32ee1481d3d0496c113653ed30baefea617d4 (diff)
CWS-TOOLING: integrate CWS kso32fixes2
2009-09-14 kso #i104767# - 64 bit build breaker 2009-09-14 kso #i14767# - compiler warning 2009-09-08 kso i104767# - Removed obsolete header. 2009-09-08 kso i104767# - Removed obsolete header include. 2009-09-08 kso #i104767# - Fixed build breaker. 2009-09-07 kso #i104767# - merged in dev300 m57. 2009-09-07 kso #i104767# - support for system credentials usage 2009-09-07 kso #i104767# - support for system credentials usage 2009-09-07 kso #i104767# - support for system credentials usage 2009-09-07 kso #i104767# - support for system credentials usage 2009-09-07 kso #i104767# - support for system credentials usage 2009-09-07 Kai Sommerfeld #i104767# - support for system credentials usage 2009-09-07 Kai Sommerfeld #i104767# - support for system credentials usage 2009-09-07 ks93798 #i104767# - adaptions for NTLM SSO
Diffstat (limited to 'ucbhelper/source/provider/simpleauthenticationrequest.cxx')
-rw-r--r--ucbhelper/source/provider/simpleauthenticationrequest.cxx125
1 files changed, 72 insertions, 53 deletions
diff --git a/ucbhelper/source/provider/simpleauthenticationrequest.cxx b/ucbhelper/source/provider/simpleauthenticationrequest.cxx
index 16570f7f012d..c5d7448fa29b 100644
--- a/ucbhelper/source/provider/simpleauthenticationrequest.cxx
+++ b/ucbhelper/source/provider/simpleauthenticationrequest.cxx
@@ -31,6 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_ucbhelper.hxx"
#include <com/sun/star/task/XMasterPasswordHandling.hpp>
+#include <com/sun/star/ucb/URLAuthenticationRequest.hpp>
#include <ucbhelper/simpleauthenticationrequest.hxx>
using namespace com::sun::star;
@@ -38,14 +39,15 @@ using namespace ucbhelper;
//=========================================================================
SimpleAuthenticationRequest::SimpleAuthenticationRequest(
+ const rtl::OUString & rURL,
const rtl::OUString & rServerName,
const rtl::OUString & rRealm,
const rtl::OUString & rUserName,
const rtl::OUString & rPassword,
const rtl::OUString & rAccount )
{
- // Fill request...
- ucb::AuthenticationRequest aRequest;
+ // Fill request...
+ ucb::URLAuthenticationRequest aRequest;
// aRequest.Message = // OUString
// aRequest.Context = // XInterface
aRequest.Classification = task::InteractionClassification_ERROR;
@@ -61,26 +63,30 @@ SimpleAuthenticationRequest::SimpleAuthenticationRequest(
aRequest.HasAccount = ( rAccount.getLength() > 0 );
if ( aRequest.HasAccount )
aRequest.Account = rAccount;
+ aRequest.URL = rURL;
- initialize(aRequest,
+ initialize(aRequest,
sal_False,
sal_True,
sal_True,
aRequest.HasAccount,
- sal_False);
+ sal_False,
+ sal_False );
}
//=========================================================================
SimpleAuthenticationRequest::SimpleAuthenticationRequest(
+ const rtl::OUString & rURL,
const rtl::OUString & rServerName,
const rtl::OUString & rRealm,
const rtl::OUString & rUserName,
const rtl::OUString & rPassword,
const rtl::OUString & rAccount,
- const sal_Bool & bAllowPersistentStoring )
+ sal_Bool bAllowPersistentStoring,
+ sal_Bool bAllowUseSystemCredentials )
{
- // Fill request...
- ucb::AuthenticationRequest aRequest;
+ // Fill request...
+ ucb::URLAuthenticationRequest aRequest;
// aRequest.Message = // OUString
// aRequest.Context = // XInterface
aRequest.Classification = task::InteractionClassification_ERROR;
@@ -96,56 +102,20 @@ SimpleAuthenticationRequest::SimpleAuthenticationRequest(
aRequest.HasAccount = ( rAccount.getLength() > 0 );
if ( aRequest.HasAccount )
aRequest.Account = rAccount;
+ aRequest.URL = rURL;
- initialize(aRequest,
+ initialize(aRequest,
sal_False,
sal_True,
sal_True,
aRequest.HasAccount,
- bAllowPersistentStoring);
-}
-
-void SimpleAuthenticationRequest::initialize(
- ucb::AuthenticationRequest aRequest,
- const sal_Bool & bCanSetRealm,
- const sal_Bool & bCanSetUserName,
- const sal_Bool & bCanSetPassword,
- const sal_Bool & bCanSetAccount,
- const sal_Bool & bAllowPersistentStoring )
-{
- setRequest( uno::makeAny( aRequest ) );
-
- // Fill continuations...
- uno::Sequence< ucb::RememberAuthentication > aRememberModes( bAllowPersistentStoring ? 3 : 2 );
- aRememberModes[ 0 ] = ucb::RememberAuthentication_NO;
- aRememberModes[ 1 ] = ucb::RememberAuthentication_SESSION;
- if (bAllowPersistentStoring)
- aRememberModes[ 1 ] = ucb::RememberAuthentication_PERSISTENT;
-
- m_xAuthSupplier
- = new InteractionSupplyAuthentication(
- this,
- bCanSetRealm,
- bCanSetUserName,
- bCanSetPassword,
- bCanSetAccount,
- aRememberModes, // rRememberPasswordModes
- ucb::RememberAuthentication_SESSION, // eDefaultRememberPasswordMode
- aRememberModes, // rRememberAccountModes
- ucb::RememberAuthentication_SESSION // eDefaultRememberAccountMode
- );
-
- uno::Sequence<
- uno::Reference< task::XInteractionContinuation > > aContinuations( 3 );
- aContinuations[ 0 ] = new InteractionAbort( this );
- aContinuations[ 1 ] = new InteractionRetry( this );
- aContinuations[ 2 ] = m_xAuthSupplier.get();
-
- setContinuations( aContinuations );
+ bAllowPersistentStoring,
+ bAllowUseSystemCredentials );
}
//=========================================================================
SimpleAuthenticationRequest::SimpleAuthenticationRequest(
+ const rtl::OUString & rURL,
const rtl::OUString & rServerName,
EntityType eRealmType,
const rtl::OUString & rRealm,
@@ -157,7 +127,7 @@ SimpleAuthenticationRequest::SimpleAuthenticationRequest(
const rtl::OUString & rAccount )
{
// Fill request...
- ucb::AuthenticationRequest aRequest;
+ ucb::URLAuthenticationRequest aRequest;
// aRequest.Message = // OUString
// aRequest.Context = // XInterface
aRequest.Classification = task::InteractionClassification_ERROR;
@@ -175,17 +145,20 @@ SimpleAuthenticationRequest::SimpleAuthenticationRequest(
aRequest.HasAccount = eAccountType != ENTITY_NA;
if ( aRequest.HasAccount )
aRequest.Account = rAccount;
+ aRequest.URL = rURL;
initialize(aRequest,
eRealmType == ENTITY_MODIFY,
eUserNameType == ENTITY_MODIFY,
ePasswordType == ENTITY_MODIFY,
eAccountType == ENTITY_MODIFY,
- sal_False);
+ sal_False,
+ sal_False );
}
//=========================================================================
SimpleAuthenticationRequest::SimpleAuthenticationRequest(
+ const rtl::OUString & rURL,
const rtl::OUString & rServerName,
EntityType eRealmType,
const rtl::OUString & rRealm,
@@ -195,10 +168,11 @@ SimpleAuthenticationRequest::SimpleAuthenticationRequest(
const rtl::OUString & rPassword,
EntityType eAccountType,
const rtl::OUString & rAccount,
- const sal_Bool & bAllowPersistentStoring )
+ sal_Bool bAllowPersistentStoring,
+ sal_Bool bAllowUseSystemCredentials )
{
// Fill request...
- ucb::AuthenticationRequest aRequest;
+ ucb::URLAuthenticationRequest aRequest;
// aRequest.Message = // OUString
// aRequest.Context = // XInterface
aRequest.Classification = task::InteractionClassification_ERROR;
@@ -216,11 +190,56 @@ SimpleAuthenticationRequest::SimpleAuthenticationRequest(
aRequest.HasAccount = eAccountType != ENTITY_NA;
if ( aRequest.HasAccount )
aRequest.Account = rAccount;
+ aRequest.URL = rURL;
initialize(aRequest,
eRealmType == ENTITY_MODIFY,
eUserNameType == ENTITY_MODIFY,
ePasswordType == ENTITY_MODIFY,
eAccountType == ENTITY_MODIFY,
- bAllowPersistentStoring);
+ bAllowPersistentStoring,
+ bAllowUseSystemCredentials );
+}
+
+//=========================================================================
+void SimpleAuthenticationRequest::initialize(
+ const ucb::URLAuthenticationRequest & rRequest,
+ sal_Bool bCanSetRealm,
+ sal_Bool bCanSetUserName,
+ sal_Bool bCanSetPassword,
+ sal_Bool bCanSetAccount,
+ sal_Bool bAllowPersistentStoring,
+ sal_Bool bAllowUseSystemCredentials )
+{
+ setRequest( uno::makeAny( rRequest ) );
+
+ // Fill continuations...
+ uno::Sequence< ucb::RememberAuthentication > aRememberModes( bAllowPersistentStoring ? 3 : 2 );
+ aRememberModes[ 0 ] = ucb::RememberAuthentication_NO;
+ aRememberModes[ 1 ] = ucb::RememberAuthentication_SESSION;
+ if (bAllowPersistentStoring)
+ aRememberModes[ 1 ] = ucb::RememberAuthentication_PERSISTENT;
+
+ m_xAuthSupplier
+ = new InteractionSupplyAuthentication(
+ this,
+ bCanSetRealm,
+ bCanSetUserName,
+ bCanSetPassword,
+ bCanSetAccount,
+ aRememberModes, // rRememberPasswordModes
+ ucb::RememberAuthentication_SESSION, // eDefaultRememberPasswordMode
+ aRememberModes, // rRememberAccountModes
+ ucb::RememberAuthentication_SESSION, // eDefaultRememberAccountMode
+ bAllowUseSystemCredentials, // bCanUseSystemCredentials,
+ false // bDefaultUseSystemCredentials
+ );
+
+ uno::Sequence<
+ uno::Reference< task::XInteractionContinuation > > aContinuations( 3 );
+ aContinuations[ 0 ] = new InteractionAbort( this );
+ aContinuations[ 1 ] = new InteractionRetry( this );
+ aContinuations[ 2 ] = m_xAuthSupplier.get();
+
+ setContinuations( aContinuations );
}