20#include <com/sun/star/ucb/URLAuthenticationRequest.hpp>
27SimpleAuthenticationRequest::SimpleAuthenticationRequest(
28 const OUString & rURL,
29 const OUString & rServerName,
30 const OUString & rRealm,
31 const OUString & rUserName,
32 const OUString & rPassword,
33 bool bAllowUseSystemCredentials,
34 bool bAllowSessionStoring )
38 ucb::URLAuthenticationRequest aRequest;
41 aRequest.Classification = task::InteractionClassification_ERROR;
42 aRequest.ServerName = rServerName;
44 aRequest.HasRealm = !rRealm.isEmpty();
45 if ( aRequest.HasRealm )
46 aRequest.Realm = rRealm;
47 aRequest.HasUserName =
true;
48 aRequest.UserName = rUserName;
49 aRequest.HasPassword =
true;
50 aRequest.Password = rPassword;
51 aRequest.HasAccount =
false;
59 bAllowUseSystemCredentials,
60 bAllowSessionStoring );
65 const OUString & rURL,
66 const OUString & rServerName,
68 const OUString & rRealm,
70 const OUString & rUserName,
72 const OUString & rPassword)
75 ucb::URLAuthenticationRequest aRequest;
78 aRequest.Classification = task::InteractionClassification_ERROR;
79 aRequest.ServerName = rServerName;
81 aRequest.HasRealm = eRealmType !=
ENTITY_NA;
82 if ( aRequest.HasRealm )
83 aRequest.Realm = rRealm;
84 aRequest.HasUserName = eUserNameType !=
ENTITY_NA;
85 if ( aRequest.HasUserName )
86 aRequest.UserName = rUserName;
87 aRequest.HasPassword = ePasswordType !=
ENTITY_NA;
88 if ( aRequest.HasPassword )
89 aRequest.Password = rPassword;
90 aRequest.HasAccount =
false;
104 const ucb::URLAuthenticationRequest & rRequest,
106 bool bCanSetUserName,
107 bool bCanSetPassword,
109 bool bAllowUseSystemCredentials,
110 bool bAllowSessionStoring )
115 unsigned int nSize = 2;
117 if( bAllowSessionStoring )
120 uno::Sequence< ucb::RememberAuthentication > aRememberModes( nSize );
121 auto it = aRememberModes.getArray();
122 *it++ = ucb::RememberAuthentication_NO;
124 if( bAllowSessionStoring )
125 *it++ = ucb::RememberAuthentication_SESSION;
127 *it = ucb::RememberAuthentication_PERSISTENT;
137 ucb::RememberAuthentication_SESSION,
139 ucb::RememberAuthentication_SESSION,
140 bAllowUseSystemCredentials
This class implements a standard interaction continuation, namely the interface XInteractionAbort.
void setRequest(const css::uno::Any &rRequest)
void setContinuations(const css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > &rContinuations)
This method sets the continuations for the request.
This class implements a standard interaction continuation, namely the interface XInteractionRetry.
This class implements a standard interaction continuation, namely the interface XInteractionSupplyAut...
void initialize(const css::ucb::URLAuthenticationRequest &rRequest, bool bCanSetRealm, bool bCanSetUserName, bool bCanSetPassword, bool bCanSetAccount, bool bAllowUseSystemCredentials, bool bAllowSessionStoring)
SimpleAuthenticationRequest(const OUString &rURL, const OUString &rServerName, const OUString &rRealm, const OUString &rUserName, const OUString &rPassword, bool bAllowUseSystemCredentials, bool bAllowSessionStoring=true)
Constructor.
EntityType
Specification whether some entity (realm, username, password, account) is either not applicable at al...
rtl::Reference< ucbhelper::InteractionSupplyAuthentication > m_xAuthSupplier