QAuthenticator

概要

函数

详细描述

PySide.QtNetwork.QAuthenticator class provides an authentication object.

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

PySide.QtNetwork.QAuthenticator supports the following authentication methods:

  • 基本
  • NTLM version 2
  • Digest-MD5

Options

In addition to the username and password required for authentication, a PySide.QtNetwork.QAuthenticator object can also contain additional options. The PySide.QtNetwork.QAuthenticator.options() function can be used to query incoming options sent by the server; the PySide.QtNetwork.QAuthenticator.setOption() 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.

基本

Option Direction 描述
realm Incoming Contains the realm of the authentication, the same as PySide.QtNetwork.QAuthenticator.realm()

The Basic authentication mechanism supports no outgoing options.

NTLM version 2

The NTLM authentication mechanism currently supports no incoming or outgoing options.

Digest-MD5

Option Direction 描述
realm Incoming Contains the realm of the authentication, the same as PySide.QtNetwork.QAuthenticator.realm()

The Digest-MD5 authentication mechanism supports no outgoing options.

class PySide.QtNetwork. QAuthenticator
class PySide.QtNetwork. QAuthenticator ( other )
参数: other PySide.QtNetwork.QAuthenticator

Constructs an empty authentication object

构造副本为 other .

PySide.QtNetwork.QAuthenticator. isNull ( )
返回类型: PySide.QtCore.bool

Returns true if the authenticator is null.

PySide.QtNetwork.QAuthenticator. __ne__ ( other )
参数: other PySide.QtNetwork.QAuthenticator
返回类型: PySide.QtCore.bool

Returns true if this authenticator is different from other ;否则返回 false。

PySide.QtNetwork.QAuthenticator. __eq__ ( other )
参数: other PySide.QtNetwork.QAuthenticator
返回类型: PySide.QtCore.bool

Returns true if this authenticator is identical to other ;否则返回 false。

PySide.QtNetwork.QAuthenticator. option ( opt )
参数: opt – unicode
返回类型: object

Returns the value related to option opt if it was set by the server. See QAuthenticator#Options for more information on incoming options. If option opt isn't found, an invalid PySide.QtCore.QVariant 将被返回。

PySide.QtNetwork.QAuthenticator. options ( )
返回类型:

Returns all incoming options set in this PySide.QtNetwork.QAuthenticator object by parsing the server reply. See QAuthenticator#Options for more information on incoming options.

另请参阅

PySide.QtNetwork.QAuthenticator.option() QAuthenticator#Options

PySide.QtNetwork.QAuthenticator. password ( )
返回类型: unicode

returns the password used for authentication.

PySide.QtNetwork.QAuthenticator. realm ( )
返回类型: unicode

returns the realm requiring authentication.

PySide.QtNetwork.QAuthenticator. setOption ( opt , value )
参数:
  • opt – unicode
  • value – object

Sets the outgoing option opt to value value 。见 QAuthenticator#Options for more information on outgoing options.

PySide.QtNetwork.QAuthenticator. setPassword ( password )
参数: password – unicode

设置 password used for authentication.

PySide.QtNetwork.QAuthenticator. setUser ( user )
参数: user – unicode

设置 user used for authentication.

PySide.QtNetwork.QAuthenticator. user ( )
返回类型: unicode

returns the user used for authentication.