QAbstractOAuth2¶
The QAbstractOAuth2
class is the base of all implementations of OAuth 2 authentication methods. More…
Inherited by: QOAuth2AuthorizationCodeFlow
Synopsis¶
Functions¶
def
clientIdentifierSharedKey
()def
expirationAt
()def
refreshToken
()def
responseType
()def
scope
()def
setClientIdentifierSharedKey
(clientIdentifierSharedKey)def
setRefreshToken
(refreshToken)def
setResponseType
(responseType)def
setScope
(scope)def
setState
(state)def
setUserAgent
(userAgent)def
state
()def
userAgent
()
Virtual functions¶
def
createAuthenticatedUrl
(url[, parameters=QVariantMap()])def
post
(url, data)def
post
(url, multiPart)def
put
(url, data)def
put
(url, multiPart)
Signals¶
def
authorizationCallbackReceived
(data)def
clientIdentifierSharedKeyChanged
(clientIdentifierSharedKey)def
error
(error, errorDescription, uri)def
expirationAtChanged
(expiration)def
refreshTokenChanged
(refreshToken)def
responseTypeChanged
(responseType)def
scopeChanged
(scope)def
stateChanged
(state)def
userAgentChanged
(userAgent)
Detailed Description¶
The class defines the basic interface of the OAuth 2 authentication classes. By inheriting this class, you can create custom authentication methods using the OAuth 2 standard for different web services.
A description of how OAuth 2 works can be found in: The OAuth 2.0 Authorization Framework
- class PySide6.QtNetworkAuth.QAbstractOAuth2(manager[, parent=None])¶
PySide6.QtNetworkAuth.QAbstractOAuth2([parent=None])
- Parameters
manager –
PySide6.QtNetwork.QNetworkAccessManager
parent –
PySide6.QtCore.QObject
Constructs a QAbstractOAuth2
object using parent
as parent and sets manager
as the network access manager.
Constructs a QAbstractOAuth2
object using parent
as parent.
- PySide6.QtNetworkAuth.QAbstractOAuth2.authorizationCallbackReceived(data)¶
- Parameters
data –
- Return type
str
This property holds the client shared key used as a password if the server requires authentication to request the token.
- Parameters
clientIdentifierSharedKey – str
- PySide6.QtNetworkAuth.QAbstractOAuth2.createAuthenticatedUrl(url[, parameters=QVariantMap()])¶
- Parameters
url –
PySide6.QtCore.QUrl
parameters –
- Return type
The returned URL is based on url
, combining it with the given parameters
and the access token.
- PySide6.QtNetworkAuth.QAbstractOAuth2.error(error, errorDescription, uri)¶
- Parameters
error – str
errorDescription – str
uri –
PySide6.QtCore.QUrl
- PySide6.QtNetworkAuth.QAbstractOAuth2.expirationAt()¶
- Return type
This property holds the expiration time of the current access token.
- PySide6.QtNetworkAuth.QAbstractOAuth2.expirationAtChanged(expiration)¶
- Parameters
expiration –
PySide6.QtCore.QDateTime
- PySide6.QtNetworkAuth.QAbstractOAuth2.post(url, multiPart)¶
- Parameters
url –
PySide6.QtCore.QUrl
multiPart –
PySide6.QtNetwork.QHttpMultiPart
- Return type
This is an overloaded function.
Sends an authenticated POST request and returns a new QNetworkReply
. The url
and multiPart
are used to create the request.
{Hypertext Transfer Protocol – HTTP/1.1: POST}
See also
post()
QHttpMultiPart
https://tools.ietf.org/html/rfc2616#section-9.6
- PySide6.QtNetworkAuth.QAbstractOAuth2.post(url, data)
- Parameters
url –
PySide6.QtCore.QUrl
data –
PySide6.QtCore.QByteArray
- Return type
This is an overloaded function.
Sends an authenticated POST request and returns a new QNetworkReply
. The url
and data
are used to create the request.
{Hypertext Transfer Protocol – HTTP/1.1: POST}
- PySide6.QtNetworkAuth.QAbstractOAuth2.put(url, data)¶
- Parameters
url –
PySide6.QtCore.QUrl
data –
PySide6.QtCore.QByteArray
- Return type
This is an overloaded function.
Sends an authenticated PUT request and returns a new QNetworkReply
. The url
and data
are used to create the request.
{Hypertext Transfer Protocol – HTTP/1.1: PUT}
- PySide6.QtNetworkAuth.QAbstractOAuth2.put(url, multiPart)
- Parameters
url –
PySide6.QtCore.QUrl
multiPart –
PySide6.QtNetwork.QHttpMultiPart
- Return type
This is an overloaded function.
Sends an authenticated PUT request and returns a new QNetworkReply
. The url
and multiPart
are used to create the request.
{Hypertext Transfer Protocol – HTTP/1.1: PUT}
See also
put()
QHttpMultiPart
https://tools.ietf.org/html/rfc2616#section-9.6
- PySide6.QtNetworkAuth.QAbstractOAuth2.refreshToken()¶
- Return type
str
- PySide6.QtNetworkAuth.QAbstractOAuth2.refreshTokenChanged(refreshToken)¶
- Parameters
refreshToken – str
- PySide6.QtNetworkAuth.QAbstractOAuth2.responseType()¶
- Return type
str
Returns the response_type used.
- PySide6.QtNetworkAuth.QAbstractOAuth2.responseTypeChanged(responseType)¶
- Parameters
responseType – str
- PySide6.QtNetworkAuth.QAbstractOAuth2.scope()¶
- Return type
str
This property holds This property holds the desired scope which defines the permissions requested by the client..
- PySide6.QtNetworkAuth.QAbstractOAuth2.scopeChanged(scope)¶
- Parameters
scope – str
- Parameters
clientIdentifierSharedKey – str
This property holds the client shared key used as a password if the server requires authentication to request the token.
- PySide6.QtNetworkAuth.QAbstractOAuth2.setRefreshToken(refreshToken)¶
- Parameters
refreshToken – str
- PySide6.QtNetworkAuth.QAbstractOAuth2.setResponseType(responseType)¶
- Parameters
responseType – str
- PySide6.QtNetworkAuth.QAbstractOAuth2.setScope(scope)¶
- Parameters
scope – str
This property holds This property holds the desired scope which defines the permissions requested by the client..
- PySide6.QtNetworkAuth.QAbstractOAuth2.setState(state)¶
- Parameters
state – str
This property holds the string sent to the server during authentication. The state is used to identify and validate the request when the callback is received.
- PySide6.QtNetworkAuth.QAbstractOAuth2.setUserAgent(userAgent)¶
- Parameters
userAgent – str
This property holds the User-Agent header used to create the network requests.
The default value is “QtOAuth/1.0 (+https://www.qt.io)”.
- PySide6.QtNetworkAuth.QAbstractOAuth2.state()¶
- Return type
str
This property holds the string sent to the server during authentication. The state is used to identify and validate the request when the callback is received.
- PySide6.QtNetworkAuth.QAbstractOAuth2.stateChanged(state)¶
- Parameters
state – str
- PySide6.QtNetworkAuth.QAbstractOAuth2.userAgent()¶
- Return type
str
This property holds the User-Agent header used to create the network requests.
The default value is “QtOAuth/1.0 (+https://www.qt.io)”.
- PySide6.QtNetworkAuth.QAbstractOAuth2.userAgentChanged(userAgent)¶
- Parameters
userAgent – str
© 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.