QOAuth1#
The QOAuth1
class provides an implementation of the OAuth 1 Protocol . More…
Synopsis#
Functions#
def
clientCredentials
()def
clientSharedSecret
()def
requestTemporaryCredentials
(operation, url[, parameters=QVariantMap()])def
requestTokenCredentials
(operation, url, temporaryToken[, parameters=QVariantMap()])def
setClientCredentials
(clientIdentifier, clientSharedSecret)def
setClientCredentials
(clientCredentials)def
setClientSharedSecret
(clientSharedSecret)def
setSignatureMethod
(value)def
setTemporaryCredentialsUrl
(url)def
setTokenCredentials
(tokenCredentials)def
setTokenCredentials
(token, tokenSecret)def
setTokenCredentialsUrl
(url)def
setTokenSecret
(tokenSecret)def
setup
(request, signingParameters, operation)def
setup
(request, signingParameters, operationVerb)def
signatureMethod
()def
temporaryCredentialsUrl
()def
tokenCredentials
()def
tokenCredentialsUrl
()def
tokenSecret
()
Slots#
def
continueGrantWithVerifier
(verifier)
Signals#
def
clientSharedSecretChanged
(credential)def
signatureMethodChanged
(method)def
temporaryCredentialsUrlChanged
(url)def
tokenCredentialsUrlChanged
(url)def
tokenSecretChanged
(token)
Static functions#
def
generateAuthorizationHeader
(oauthParams)def
nonce
()
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:
clientIdentifier – str
manager –
PySide6.QtNetwork.QNetworkAccessManager
clientSharedSecret – str
parent –
PySide6.QtCore.QObject
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.
- PySide6.QtNetworkAuth.QOAuth1.clientCredentials()#
Returns the pair of QString
used to identify the application and sign requests to the web server.
See also
- Return type:
str
Returns the current shared secret used to sign requests to the web server.
- 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:
Generates an authorization header using oauthParams
.
See also: The OAuth 1.0 Protocol: Authorization Header
- static PySide6.QtNetworkAuth.QOAuth1.nonce()#
- Return type:
Generates a nonce.
See also: The OAuth 1.0 Protocol: Nonce and Timestamp
- PySide6.QtNetworkAuth.QOAuth1.requestTemporaryCredentials(operation, url[, parameters=QVariantMap()])#
- Parameters:
operation –
Operation
url –
PySide6.QtCore.QUrl
parameters –
- Return type:
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:
operation –
Operation
url –
PySide6.QtCore.QUrl
temporaryToken –
parameters –
- Return type:
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.
See also
- 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.
See also
- Parameters:
clientSharedSecret – str
Sets clientSharedSecret
as the string used to sign the requests to the web server.
- PySide6.QtNetworkAuth.QOAuth1.setSignatureMethod(value)#
- Parameters:
value –
SignatureMethod
Sets value
as the method used to sign requests to the web server.
See also
- PySide6.QtNetworkAuth.QOAuth1.setTemporaryCredentialsUrl(url)#
- Parameters:
url –
PySide6.QtCore.QUrl
Sets url
as the URL to request temporary credentials to start the authentication process.
See also
- 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.
See also
- 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.
See also
- PySide6.QtNetworkAuth.QOAuth1.setTokenCredentialsUrl(url)#
- Parameters:
url –
PySide6.QtCore.QUrl
Sets url
as the URL to request the token credentials to continue the authentication process.
See also
- PySide6.QtNetworkAuth.QOAuth1.setTokenSecret(tokenSecret)#
- Parameters:
tokenSecret – str
Sets tokenSecret
as the current token secret used to sign authenticated calls to the web server.
See also
- PySide6.QtNetworkAuth.QOAuth1.setup(request, signingParameters, operation)#
- Parameters:
request –
PySide6.QtNetwork.QNetworkRequest
signingParameters –
operation –
Operation
- PySide6.QtNetworkAuth.QOAuth1.setup(request, signingParameters, operationVerb)
- Parameters:
request –
PySide6.QtNetwork.QNetworkRequest
signingParameters –
operationVerb –
PySide6.QtCore.QByteArray
- PySide6.QtNetworkAuth.QOAuth1.signatureMethod()#
- Return type:
Returns the method used to sign the request to the web server.
See also
- PySide6.QtNetworkAuth.QOAuth1.signatureMethodChanged(method)#
- Parameters:
method –
SignatureMethod
- PySide6.QtNetworkAuth.QOAuth1.temporaryCredentialsUrl()#
- Return type:
Returns the url used to request temporary credentials to start the authentication process.
See also
- PySide6.QtNetworkAuth.QOAuth1.temporaryCredentialsUrlChanged(url)#
- Parameters:
url –
PySide6.QtCore.QUrl
- PySide6.QtNetworkAuth.QOAuth1.tokenCredentials()#
Returns the pair of QString
used to identify and sign authenticated requests to the web server.
See also
- PySide6.QtNetworkAuth.QOAuth1.tokenCredentialsUrl()#
- Return type:
Returns the url used to request token credentials to continue the authentication process.
See also
- PySide6.QtNetworkAuth.QOAuth1.tokenCredentialsUrlChanged(url)#
- Parameters:
url –
PySide6.QtCore.QUrl
- PySide6.QtNetworkAuth.QOAuth1.tokenSecret()#
- Return type:
str
Returns the current token secret used to sign authenticated requests to the web server.
See also
- PySide6.QtNetworkAuth.QOAuth1.tokenSecretChanged(token)#
- Parameters:
token – str