Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QAuthenticator Class Reference

The QAuthenticator class provides an authentication object. More...

#include <qauthenticator.h>

Collaboration diagram for QAuthenticator:

Public Member Functions

 QAuthenticator ()
 Constructs an empty authentication object.
 ~QAuthenticator ()
 Destructs the object.
 QAuthenticator (const QAuthenticator &other)
 Constructs a copy of other.
QAuthenticatoroperator= (const QAuthenticator &other)
 Assigns the contents of other to this authenticator.
bool operator== (const QAuthenticator &other) const
 Returns true if this authenticator is identical to other; otherwise returns false.
bool operator!= (const QAuthenticator &other) const
 Returns true if this authenticator is different from other; otherwise returns false.
QString user () const
 Returns the user used for authentication.
void setUser (const QString &user)
 Sets the user used for authentication.
QString password () const
 Returns the password used for authentication.
void setPassword (const QString &password)
 Sets the password used for authentication.
QString realm () const
 Returns the realm requiring authentication.
void setRealm (const QString &realm)
QVariant option (const QString &opt) const
QVariantHash options () const
void setOption (const QString &opt, const QVariant &value)
bool isNull () const
 Returns true if the object has not been initialized.
void detach ()
void clear () noexcept

Friends

class QAuthenticatorPrivate

Detailed Description

The QAuthenticator class provides an authentication object.

Since
4.3

\reentrant

\inmodule QtNetwork

The QAuthenticator class is usually used in the \l{QNetworkAccessManager::}{authenticationRequired()} and \l{QNetworkAccessManager::}{proxyAuthenticationRequired()} signals of QNetworkAccessManager and QAbstractSocket. The class provides a way to pass back the required authentication information to the socket when accessing services that require authentication.

QAuthenticator supports the following authentication methods: \list

  • Basic
  • NTLM version 2
  • Digest-MD5
  • SPNEGO/Negotiate \endlist

\target qauthenticator-options

Definition at line 18 of file qauthenticator.h.

Constructor & Destructor Documentation

◆ QAuthenticator() [1/2]

QAuthenticator::QAuthenticator ( )

Constructs an empty authentication object.

Definition at line 154 of file qauthenticator.cpp.

◆ ~QAuthenticator()

QAuthenticator::~QAuthenticator ( )

Destructs the object.

Definition at line 162 of file qauthenticator.cpp.

◆ QAuthenticator() [2/2]

QAuthenticator::QAuthenticator ( const QAuthenticator & other)

Constructs a copy of other.

Definition at line 171 of file qauthenticator.cpp.

Member Function Documentation

◆ clear()

void QAuthenticator::clear ( )
noexcept
Since
6.11

Clears all credentials and resets the object to its default uninitialized state.

Definition at line 368 of file qauthenticator.cpp.

◆ detach()

void QAuthenticator::detach ( )

Definition at line 276 of file qauthenticator.cpp.

◆ isNull()

bool QAuthenticator::isNull ( ) const

Returns true if the object has not been initialized.

Returns false if non-const member functions have been called, or the content was constructed or copied from another initialized QAuthenticator object.

Definition at line 356 of file qauthenticator.cpp.

◆ operator!=()

bool QAuthenticator::operator!= ( const QAuthenticator & other) const
inline

Returns true if this authenticator is different from other; otherwise returns false.

Definition at line 29 of file qauthenticator.h.

◆ operator=()

QAuthenticator & QAuthenticator::operator= ( const QAuthenticator & other)

Assigns the contents of other to this authenticator.

Definition at line 181 of file qauthenticator.cpp.

◆ operator==()

bool QAuthenticator::operator== ( const QAuthenticator & other) const

Returns true if this authenticator is identical to other; otherwise returns false.

Definition at line 210 of file qauthenticator.cpp.

◆ option()

QVariant QAuthenticator::option ( const QString & opt) const
Since
4.7 Returns the value related to option opt if it was set by the server. See the \l{QAuthenticator#qauthenticator-options}{Options section} for more information on incoming options. If option opt isn't found, an invalid QVariant will be returned.
See also
options(), {QAuthenticator#qauthenticator-options}{QAuthenticator options}

Definition at line 315 of file qauthenticator.cpp.

◆ options()

QVariantHash QAuthenticator::options ( ) const
Since
4.7 Returns all incoming options set in this QAuthenticator object by parsing the server reply. See the \l{QAuthenticator#qauthenticator-options}{Options section} for more information on incoming options.
See also
option(), {QAuthenticator#qauthenticator-options}{QAuthenticator options}

Definition at line 328 of file qauthenticator.cpp.

Referenced by testing.tools.test_runner._TestCaseRunner::_NewImageArtifact(), testing.tools.test_runner._TestCaseRunner::_RegenerateIfNeeded(), testing.tools.test_runner.TestRunner::IsSkiaGoldEnabled(), testing.tools.test_runner._TestCaseRunner::TestPixel(), and testing.tools.test_runner._TestCaseRunner::TestText().

Here is the caller graph for this function:

◆ password()

QString QAuthenticator::password ( ) const

Returns the password used for authentication.

Definition at line 255 of file qauthenticator.cpp.

◆ realm()

QString QAuthenticator::realm ( ) const

Returns the realm requiring authentication.

Definition at line 290 of file qauthenticator.cpp.

◆ setOption()

void QAuthenticator::setOption ( const QString & opt,
const QVariant & value )
Since
4.7

Sets the outgoing option opt to value value. See the \l{QAuthenticator#qauthenticator-options}{Options section} for more information on outgoing options.

See also
options(), option(), {QAuthenticator#qauthenticator-options}{QAuthenticator options}

Definition at line 341 of file qauthenticator.cpp.

◆ setPassword()

void QAuthenticator::setPassword ( const QString & password)

Sets the password used for authentication.

See also
QNetworkAccessManager::authenticationRequired()

Definition at line 265 of file qauthenticator.cpp.

◆ setRealm()

void QAuthenticator::setRealm ( const QString & realm)

Definition at line 298 of file qauthenticator.cpp.

◆ setUser()

void QAuthenticator::setUser ( const QString & user)

Sets the user used for authentication.

See also
QNetworkAccessManager::authenticationRequired()

Definition at line 243 of file qauthenticator.cpp.

◆ user()

QString QAuthenticator::user ( ) const

Returns the user used for authentication.

Definition at line 233 of file qauthenticator.cpp.

◆ QAuthenticatorPrivate

friend class QAuthenticatorPrivate
friend

Definition at line 49 of file qauthenticator.h.


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