LibreOffice Module uui (master) 1
Public Member Functions | Private Attributes | List of all members
uui::PasswordContainerHelper Class Reference

Passwordcontainer UNO service (com.sun.star.task.PasswordContainer) helper. More...

#include <passwordcontainer.hxx>

Public Member Functions

 PasswordContainerHelper (css::uno::Reference< css::uno::XComponentContext > const &xContext)
 
bool handleAuthenticationRequest (css::ucb::AuthenticationRequest const &rRequest, css::uno::Reference< css::ucb::XInteractionSupplyAuthentication > const &xSupplyAuthentication, OUString const &rURL, css::uno::Reference< css::task::XInteractionHandler2 > const &xIH)
 This member function tries to handle an authentication interaction request by looking up credentials for the given URL in the password container service. More...
 
bool addRecord (OUString const &rURL, OUString const &rUsername, css::uno::Sequence< OUString > const &rPasswords, css::uno::Reference< css::task::XInteractionHandler2 > const &xIH, bool bPersist)
 This member function adds credentials for the given URL to the password container. More...
 

Private Attributes

css::uno::Reference< css::task::XPasswordContainer2 > m_xPasswordContainer
 

Detailed Description

Passwordcontainer UNO service (com.sun.star.task.PasswordContainer) helper.

Definition at line 42 of file passwordcontainer.hxx.

Constructor & Destructor Documentation

◆ PasswordContainerHelper()

uui::PasswordContainerHelper::PasswordContainerHelper ( css::uno::Reference< css::uno::XComponentContext > const &  xContext)
explicit

Definition at line 111 of file passwordcontainer.cxx.

References create().

Member Function Documentation

◆ addRecord()

bool uui::PasswordContainerHelper::addRecord ( OUString const &  rURL,
OUString const &  rUsername,
css::uno::Sequence< OUString > const &  rPasswords,
css::uno::Reference< css::task::XInteractionHandler2 > const &  xIH,
bool  bPersist 
)

This member function adds credentials for the given URL to the password container.

Parameters
rURLThe URL the credentials are valid for. rURL must not be empty.
rUsernameThe user name.
rPasswordsThis list of passwords.
xIHThe interaction handler to use, for example if a master password is needed to access the password container.
bPersistTrue, the record will get stored persistently; restored upon password container initialization False, the record will be stored until password container instance gets destroyed.
Returns
True, if the record was added successfully. False, otherwise.

Definition at line 225 of file passwordcontainer.cxx.

References m_xPasswordContainer.

◆ handleAuthenticationRequest()

bool uui::PasswordContainerHelper::handleAuthenticationRequest ( css::ucb::AuthenticationRequest const &  rRequest,
css::uno::Reference< css::ucb::XInteractionSupplyAuthentication > const &  xSupplyAuthentication,
OUString const &  rURL,
css::uno::Reference< css::task::XInteractionHandler2 > const &  xIH 
)

This member function tries to handle an authentication interaction request by looking up credentials for the given URL in the password container service.

In case of success the given interaction continuation (XInteractionSupplyAuthentication) is filled with the credentials found in the password container.

Please note the continuation gets not "selected" by this implementation. "Selecting" the continuation is up to the caller (e.g. an implementation of XInteractionHandler::handle) of this function.

Parameters
rRequestThe authentication request.
xSupplyAuthenticationThe "supply authentication" interaction continuation.
rURLThe URL to lookup credentials for.
xIHThe interaction handler to use, for example if a master password is needed to access the password container.
Returns
True, if the authentication request was handled successfully. False, otherwise.

Definition at line 117 of file passwordcontainer.cxx.

References m_xPasswordContainer.

Member Data Documentation

◆ m_xPasswordContainer

css::uno::Reference< css::task::XPasswordContainer2 > uui::PasswordContainerHelper::m_xPasswordContainer
private

Definition at line 119 of file passwordcontainer.hxx.

Referenced by addRecord(), and handleAuthenticationRequest().


The documentation for this class was generated from the following files: