QtPdCom  1.5.2
QtPdCom::LoginManager Class Reference

Class to handle the Authentication process. More...

#include <LoginManager.h>

Inheritance diagram for QtPdCom::LoginManager:
Collaboration diagram for QtPdCom::LoginManager:

Signals

void needCredentials ()
 Username and/or password has not been set.
void loginSuccessful ()
 Authentification was successful.
void loginFailed ()
 Authentification was not successful.

Public Member Functions

 LoginManager (QString server_name=QString(), QObject *parent=nullptr)
 ~LoginManager ()
Q_INVOKABLE void setAuthName (QString name)
 Set Login Name.
Q_INVOKABLE void setPassword (QString password)
 Set Password.
Q_INVOKABLE void clearCredentials ()
 Clear stored credentials.
Q_INVOKABLE void login ()
 Start the login process.
Q_INVOKABLE void logout ()
 logout.
Q_INVOKABLE QString getErrorMessage ()

Static Public Member Functions

static void InitLibrary (const char *plugin_path=nullptr)
 Sasl global initialization.
static void FinalizeLibrary ()
 Sasl global finalization.

Private Member Functions

 Q_DECLARE_PRIVATE (LoginManager)
 Q_DISABLE_COPY (LoginManager)
LoginManageroperator= (LoginManager &&)=delete
 LoginManager (LoginManager &&)=delete

Private Attributes

QScopedPointer< LoginManagerPrivated_ptr
friend Process

Detailed Description

Class to handle the Authentication process.

Prior to using an instance of this class, InitLibrary() has to be called.

In Qt6 QML, simply create an SaslInitializer instance before connecting to a process.

Constructor & Destructor Documentation

◆ LoginManager() [1/2]

LoginManager::LoginManager ( QString server_name = QString(),
QObject * parent = nullptr )
explicit

◆ ~LoginManager()

LoginManager::~LoginManager ( )
default

◆ LoginManager() [2/2]

QtPdCom::LoginManager::LoginManager ( LoginManager && )
privatedelete

References LoginManager().

Member Function Documentation

◆ clearCredentials()

void LoginManager::clearCredentials ( )

Clear stored credentials.

References LoginManager().

Referenced by ~LoginManager().

◆ FinalizeLibrary()

void LoginManager::FinalizeLibrary ( )
static

Sasl global finalization.

Referenced by ~LoginManager(), and QtPdCom::SaslInitializer::~SaslInitializer().

◆ getErrorMessage()

QString LoginManager::getErrorMessage ( )

References LoginManager().

Referenced by ~LoginManager().

◆ InitLibrary()

void LoginManager::InitLibrary ( const char * plugin_path = nullptr)
static

Sasl global initialization.

Call this at startup of your application to initialize the underlying sasl library.

Parameters
plugin_pathPath to SASL.
Exceptions
PdCom::ExceptionInitialization failed.

Referenced by QtPdCom::SaslInitializer::SaslInitializer(), and ~LoginManager().

◆ login()

void LoginManager::login ( )

Start the login process.

If possible, please call setAuthName() and setPassword() in advance. Do not call login() from whithin any Authentification-related callback (i.e. slots connected to any of our signals which are not queued connections) as use-after-free can happen as a new session is started.

References LoginManager().

Referenced by ~LoginManager().

◆ loginFailed

void QtPdCom::LoginManager::loginFailed ( )
signal

Authentification was not successful.

See getErrorMessage().

◆ loginSuccessful

void QtPdCom::LoginManager::loginSuccessful ( )
signal

Authentification was successful.

◆ logout()

void LoginManager::logout ( )

logout.

References LoginManager().

Referenced by ~LoginManager().

◆ needCredentials

void QtPdCom::LoginManager::needCredentials ( )
signal

Username and/or password has not been set.

◆ operator=()

LoginManager & QtPdCom::LoginManager::operator= ( LoginManager && )
privatedelete

References LoginManager().

◆ Q_DECLARE_PRIVATE()

QtPdCom::LoginManager::Q_DECLARE_PRIVATE ( LoginManager )
private

References LoginManager().

◆ Q_DISABLE_COPY()

QtPdCom::LoginManager::Q_DISABLE_COPY ( LoginManager )
private

References LoginManager().

◆ setAuthName()

void LoginManager::setAuthName ( QString name)

Set Login Name.

Parameters
nameLogin name.

References LoginManager().

Referenced by ~LoginManager().

◆ setPassword()

void LoginManager::setPassword ( QString password)

Set Password.

Parameters
passwordPassword.

References LoginManager().

Referenced by ~LoginManager().

Member Data Documentation

◆ d_ptr

QScopedPointer<LoginManagerPrivate> QtPdCom::LoginManager::d_ptr
private

◆ Process

friend QtPdCom::LoginManager::Process
private

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