QOAuth1#

The QOAuth1 class provides an implementation of the OAuth 1 Protocol . More

Inheritance diagram of PySide6.QtNetworkAuth.QOAuth1

Synopsis#

Functions#

Slots#

Signals#

Static functions#

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description#

QOAuth1 provides a method for clients to access server resources on behalf of a resource owner (such as a different client or an end-user). It also provides a process for end-users to authorize third-party access to their server resources without sharing their credentials (typically, a username and password pair), using user-agent redirections.

QOAuth1 uses tokens to represent the authorization granted to the client by the resource owner. Typically, token credentials are issued by the server at the resource owner’s request, after authenticating the resource owner’s identity (usually using a username and password).

When making the temporary credentials request, the client authenticates using only the client credentials. When making the token request, the client authenticates using the client credentials as well as the temporary credentials. Once the client receives and stores the token credentials, it can proceed to access protected resources on behalf of the resource owner by making authenticated requests using the client credentials together with the token credentials received.

class PySide6.QtNetworkAuth.QOAuth1(manager[, parent=None])#

PySide6.QtNetworkAuth.QOAuth1([parent=None])

PySide6.QtNetworkAuth.QOAuth1(clientIdentifier, clientSharedSecret, manager[, parent=None])

Parameters:

Constructs a QOAuth1 object with parent object parent, using manager to access the network.

Constructs a QOAuth1 object with parent object parent.

Constructs a QOAuth1 object with parent object parent, using manager to access the network. Also sets clientIdentifier and clientSharedSecret to sign the calls to the web server and identify the application.

PySide6.QtNetworkAuth.QOAuth1.SignatureMethod#

Indicates the signature method to be used to sign requests.

Constant

Description

QOAuth1.SignatureMethod.Hmac_Sha1

HMAC-SHA1 signature method.

QOAuth1.SignatureMethod.Rsa_Sha1

RSA-SHA1 signature method (not supported).

QOAuth1.SignatureMethod.PlainText

PLAINTEXT signature method.

PySide6.QtNetworkAuth.QOAuth1.clientCredentials()#
Return type:

Returns the pair of QString used to identify the application and sign requests to the web server.

PySide6.QtNetworkAuth.QOAuth1.clientSharedSecret()#
Return type:

str

Returns the current shared secret used to sign requests to the web server.

PySide6.QtNetworkAuth.QOAuth1.clientSharedSecretChanged(credential)#
Parameters:

credential – str

PySide6.QtNetworkAuth.QOAuth1.continueGrantWithVerifier(verifier)#
Parameters:

verifier – str

Continues the Redirection-Based Authorization flow using verifier. Call this function when using an Out-of-band reply handler to supply the verifier provided by the web server.

static PySide6.QtNetworkAuth.QOAuth1.generateAuthorizationHeader(oauthParams)#
Parameters:

oauthParams

Return type:

PySide6.QtCore.QByteArray

Generates an authorization header using oauthParams.

See also: The OAuth 1.0 Protocol: Authorization Header

static PySide6.QtNetworkAuth.QOAuth1.nonce()#
Return type:

PySide6.QtCore.QByteArray

Generates a nonce.

See also: The OAuth 1.0 Protocol: Nonce and Timestamp

PySide6.QtNetworkAuth.QOAuth1.requestTemporaryCredentials(operation, url[, parameters=QVariantMap()])#
Parameters:
Return type:

PySide6.QtNetwork.QNetworkReply

Starts the a request for temporary credentials using the request method operation. The request URL is url and the parameters shall encoded and sent during the request.

See also: The OAuth 1.0 Protocol: Temporary Credentials

PySide6.QtNetworkAuth.QOAuth1.requestTokenCredentials(operation, url, temporaryToken[, parameters=QVariantMap()])#
Parameters:
Return type:

PySide6.QtNetwork.QNetworkReply

Starts a request for token credentials using the request method operation. The request URL is url and the parameters shall be encoded and sent during the request. The temporaryToken pair of string is used to identify and sign the request.

See also: The OAuth 1.0 Protocol: Token Credentials

PySide6.QtNetworkAuth.QOAuth1.setClientCredentials(clientIdentifier, clientSharedSecret)#
Parameters:
  • clientIdentifier – str

  • clientSharedSecret – str

Sets clientIdentifier and clientSharedSecret as the pair of QString used to identify the application and sign requests to the web server. clientIdentifier identifies the application and clientSharedSecret is used to sign requests.

PySide6.QtNetworkAuth.QOAuth1.setClientCredentials(clientCredentials)
Parameters:

clientCredentials

Sets clientCredentials as the pair of QString used to identify the application and sign requests to the web server.

PySide6.QtNetworkAuth.QOAuth1.setClientSharedSecret(clientSharedSecret)#
Parameters:

clientSharedSecret – str

Sets clientSharedSecret as the string used to sign the requests to the web server.

PySide6.QtNetworkAuth.QOAuth1.setSignatureMethod(value)#
Parameters:

valueSignatureMethod

Sets value as the method used to sign requests to the web server.

PySide6.QtNetworkAuth.QOAuth1.setTemporaryCredentialsUrl(url)#
Parameters:

urlPySide6.QtCore.QUrl

Sets url as the URL to request temporary credentials to start the authentication process.

PySide6.QtNetworkAuth.QOAuth1.setTokenCredentials(tokenCredentials)#
Parameters:

tokenCredentials

Sets tokenCredentials as the pair of QString used to identify and sign authenticated requests to the web server.

PySide6.QtNetworkAuth.QOAuth1.setTokenCredentials(token, tokenSecret)
Parameters:
  • token – str

  • tokenSecret – str

Sets token and tokenSecret as the pair of QString used to identify and sign authenticated requests to the web server. Once the client receives and stores the token credentials, it can proceed to access protected resources on behalf of the resource owner by making authenticated requests using the client credentials together with the token credentials received.

PySide6.QtNetworkAuth.QOAuth1.setTokenCredentialsUrl(url)#
Parameters:

urlPySide6.QtCore.QUrl

Sets url as the URL to request the token credentials to continue the authentication process.

PySide6.QtNetworkAuth.QOAuth1.setTokenSecret(tokenSecret)#
Parameters:

tokenSecret – str

Sets tokenSecret as the current token secret used to sign authenticated calls to the web server.

PySide6.QtNetworkAuth.QOAuth1.setup(request, signingParameters, operation)#
Parameters:
PySide6.QtNetworkAuth.QOAuth1.setup(request, signingParameters, operationVerb)
Parameters:
PySide6.QtNetworkAuth.QOAuth1.signatureMethod()#
Return type:

SignatureMethod

Returns the method used to sign the request to the web server.

PySide6.QtNetworkAuth.QOAuth1.signatureMethodChanged(method)#
Parameters:

methodSignatureMethod

PySide6.QtNetworkAuth.QOAuth1.temporaryCredentialsUrl()#
Return type:

PySide6.QtCore.QUrl

Returns the url used to request temporary credentials to start the authentication process.

PySide6.QtNetworkAuth.QOAuth1.temporaryCredentialsUrlChanged(url)#
Parameters:

urlPySide6.QtCore.QUrl

PySide6.QtNetworkAuth.QOAuth1.tokenCredentials()#
Return type:

Returns the pair of QString used to identify and sign authenticated requests to the web server.

PySide6.QtNetworkAuth.QOAuth1.tokenCredentialsUrl()#
Return type:

PySide6.QtCore.QUrl

Returns the url used to request token credentials to continue the authentication process.

PySide6.QtNetworkAuth.QOAuth1.tokenCredentialsUrlChanged(url)#
Parameters:

urlPySide6.QtCore.QUrl

PySide6.QtNetworkAuth.QOAuth1.tokenSecret()#
Return type:

str

Returns the current token secret used to sign authenticated requests to the web server.

PySide6.QtNetworkAuth.QOAuth1.tokenSecretChanged(token)#
Parameters:

token – str