class QOAuth2AuthorizationCodeFlow#

The QOAuth2AuthorizationCodeFlow class provides an implementation of the Authorization Code Grant flow. More

Inheritance diagram of PySide6.QtNetworkAuth.QOAuth2AuthorizationCodeFlow

Synopsis#

Properties#

  • accessTokenUrlᅟ - This property holds the URL used to convert the temporary code received during the authorization response

Methods#

Slots#

Signals#

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#

This class implements the Authorization Code Grant flow, which is used both to obtain and to refresh access tokens. It is a redirection-based flow so the user will need access to a web browser.

Note

Properties can be used directly when from __feature__ import true_property is used or via accessor functions otherwise.

property accessTokenUrlᅟ: QUrl#

This property holds This property holds the URL used to convert the temporary code received during the authorization response..

See also: Access Token Request

Access functions:
__init__(manager[, parent=None])#
Parameters:

Constructs a QOAuth2AuthorizationCodeFlow object using parent as parent and sets manager as the network access manager.

__init__([parent=None])
Parameters:

parentQObject

Constructs a QOAuth2AuthorizationCodeFlow object with parent object parent.

__init__(clientIdentifier, manager[, parent=None])
Parameters:

Constructs a QOAuth2AuthorizationCodeFlow object using parent as parent and sets manager as the network access manager. The client identifier is set to clientIdentifier.

__init__(clientIdentifier, authorizationUrl, accessTokenUrl, manager[, parent=None])
Parameters:

Constructs a QOAuth2AuthorizationCodeFlow object using parent as parent and sets manager as the network access manager. The client identifier is set to clientIdentifier the authenticate URL is set to authenticateUrl and the access token URL is set to accessTokenUrl.

__init__(authorizationUrl, accessTokenUrl, manager[, parent=None])
Parameters:

Constructs a QOAuth2AuthorizationCodeFlow object using parent as parent and sets manager as the network access manager. The authenticate URL is set to authenticateUrl and the access token URL is set to accessTokenUrl.

accessTokenUrl()#
Return type:

QUrl

Returns the URL used to request the access token.

Getter of property accessTokenUrlᅟ .

accessTokenUrlChanged(accessTokenUrl)#
Parameters:

accessTokenUrlQUrl

Notification signal of property accessTokenUrlᅟ .

buildAuthenticateUrl([parameters={}])#
Parameters:

parameters – .QMultiMapQString,QVariant

Return type:

QUrl

Generates an authentication URL to be used in the Authorization Request using parameters.

refreshAccessToken()#

Call this function to refresh the token. Access tokens are not permanent. After a time specified along with the access token when it was obtained, the access token will become invalid.

If refreshing the token fails and an access token exists, the status is set to Granted , and to NotAuthenticated otherwise.

requestAccessToken(code)#
Parameters:

code – str

Requests an access token from the received code. The code is received as a response when the user completes a successful authentication in the browser.

setAccessTokenUrl(accessTokenUrl)#
Parameters:

accessTokenUrlQUrl

Sets the URL used to request the access token to accessTokenUrl.

See also

accessTokenUrl()

Setter of property accessTokenUrlᅟ .