QAuthenticator¶
The
QAuthenticator
class provides an authentication object. More…
Synopsis¶
Functions¶
Detailed Description¶
The
QAuthenticator
class is usually used in theauthenticationRequired()
andproxyAuthenticationRequired()
signals ofQNetworkAccessManager
andQAbstractSocket
. 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:
Basic
NTLM version 2
Digest-MD5
SPNEGO/Negotiate
Options¶
In addition to the username and password required for authentication, a
QAuthenticator
object can also contain additional options. Theoptions()
function can be used to query incoming options sent by the server; thesetOption()
function 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.
Basic¶
Option
Direction
Type
Description
realm
Incoming
QString
Contains the realm of the authentication, the same as
realm()
The Basic authentication mechanism supports no outgoing options.
NTLM version 2¶
The NTLM authentication mechanism currently supports no incoming or outgoing options. On Windows, if no
user
has been set, domain\user credentials will be searched for on the local system to enable Single-Sign-On functionality.
Digest-MD5¶
Option
Direction
Type
Description
realm
Incoming
QString
Contains the realm of the authentication, the same as
realm()
The Digest-MD5 authentication mechanism supports no outgoing options.
SPNEGO/Negotiate¶
This authentication mechanism currently supports no incoming or outgoing options.
See also
- class PySide2.QtNetwork.QAuthenticator¶
PySide2.QtNetwork.QAuthenticator(other)
- param other:
Constructs an empty authentication object.
Constructs a copy of
other
.
- PySide2.QtNetwork.QAuthenticator.isNull()¶
- Return type:
bool
Returns
true
if the object has not been initialized. Returnsfalse
if non-const member functions have been called, or the content was constructed or copied from another initializedQAuthenticator
object.
- PySide2.QtNetwork.QAuthenticator.__ne__(other)¶
- Parameters:
other –
PySide2.QtNetwork.QAuthenticator
- Return type:
bool
Returns
true
if this authenticator is different fromother
; otherwise returnsfalse
.
- PySide2.QtNetwork.QAuthenticator.__eq__(other)¶
- Parameters:
other –
PySide2.QtNetwork.QAuthenticator
- Return type:
bool
Returns
true
if this authenticator is identical toother
; otherwise returnsfalse
.
- PySide2.QtNetwork.QAuthenticator.option(opt)¶
- Parameters:
opt – str
- Return type:
object
Returns the value related to option
opt
if it was set by the server. See theOptions section
for more information on incoming options. If optionopt
isn’t found, an invalidQVariant
will be returned.See also
setOption()
options()
QAuthenticator options
- PySide2.QtNetwork.QAuthenticator.options()¶
- Return type:
Returns all incoming options set in this
QAuthenticator
object by parsing the server reply. See theOptions section
for more information on incoming options.See also
option()
QAuthenticator options
- PySide2.QtNetwork.QAuthenticator.password()¶
- Return type:
str
Returns the password used for authentication.
See also
- PySide2.QtNetwork.QAuthenticator.realm()¶
- Return type:
str
Returns the realm requiring authentication.
- PySide2.QtNetwork.QAuthenticator.setOption(opt, value)¶
- Parameters:
opt – str
value – object
Sets the outgoing option
opt
to valuevalue
. See theOptions section
for more information on outgoing options.
- PySide2.QtNetwork.QAuthenticator.setPassword(password)¶
- Parameters:
password – str
Sets the
password
used for authentication.See also
- PySide2.QtNetwork.QAuthenticator.setUser(user)¶
- Parameters:
user – str
Sets the
user
used for authentication.See also
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.