CopperSpice API
1.9.2
|
The QAuthenticator class provides an authentication object. More...
Public Methods | |
QAuthenticator () | |
QAuthenticator (const QAuthenticator &other) | |
~QAuthenticator () | |
bool | isNull () const |
bool | operator!= (const QAuthenticator &other) const |
QAuthenticator & | operator= (const QAuthenticator &other) |
bool | operator== (const QAuthenticator &other) const |
QVariant | option (const QString &opt) const |
QVariantHash | options () const |
QString | password () const |
QString | realm () const |
void | setOption (const QString &opt, const QVariant &value) |
void | setPassword (const QString &password) |
void | setUser (const QString &user) |
QString | user () const |
The QAuthenticator class provides an authentication object. This class is usually used in the authenticationRequired() and 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:
In addition to the username and password required for authentication, a QAuthenticator object can also contain additional options. The options() method can be used to query incoming options sent by the server; the setOption() method can be used to set outgoing options, to be processed by the authenticator calculation. The options accepted and provided depend on the authentication type (see method()).
The following tables list known incoming options as well as accepted outgoing options. The list of incoming options is not exhaustive, since servers may include additional information at any time. The list of outgoing options is exhaustive, however, and no unknown options will be treated or sent back to the server.
Option | Direction | Description |
---|---|---|
realm | Incoming | Contains the realm of the authentication, the same as realm() |
The Basic authentication mechanism supports no outgoing options.
The NTLM authentication mechanism currently supports no incoming or outgoing options.
Option | Direction | Description |
---|---|---|
realm | Incoming | Contains the realm of the authentication, the same as realm() |
The Digest-MD5 authentication mechanism supports no outgoing options.
QAuthenticator::QAuthenticator | ( | ) |
Constructs an empty authentication object
QAuthenticator::~QAuthenticator | ( | ) |
Destructs the object
QAuthenticator::QAuthenticator | ( | const QAuthenticator & | other | ) |
Constructs a copy of other.
bool QAuthenticator::isNull | ( | ) | const |
Returns true if the authenticator is null.
|
inline |
Returns true if this authenticator is different from other, otherwise returns false.
QAuthenticator & QAuthenticator::operator= | ( | const QAuthenticator & | other | ) |
Copy assigns from other and returns a reference to this object.
bool QAuthenticator::operator== | ( | const QAuthenticator & | other | ) | const |
Returns true if this authenticator is identical to other, otherwise returns false.
Returns the value related to the given opt if it was set by the server. If opt is not found, an invalid QVariant will be returned.
QVariantHash QAuthenticator::options | ( | ) | const |
Returns all incoming options set in this QAuthenticator object by parsing the server reply.
QString QAuthenticator::password | ( | ) | const |
Returns the password used for authentication.
QString QAuthenticator::realm | ( | ) | const |
Returns the realm requiring authentication.
Sets the outgoing opt to the given value.
void QAuthenticator::setPassword | ( | const QString & | password | ) |
Sets the password used for authentication.
void QAuthenticator::setUser | ( | const QString & | user | ) |
Sets the user used for authentication.