The QOAuth2AuthorizationCodeFlow class provides an implementation of the Authorization Code Grant flow. 更多...
头: | #include <QOAuth2AuthorizationCodeFlow> |
qmake: | QT += networkauth |
Since: | Qt 5.8 |
继承: | QAbstractOAuth2 |
QOAuth2AuthorizationCodeFlow (QObject * parent = nullptr) | |
QOAuth2AuthorizationCodeFlow (QNetworkAccessManager * manager , QObject * parent = nullptr) | |
QOAuth2AuthorizationCodeFlow (const QString & clientIdentifier , QNetworkAccessManager * manager , QObject * parent = nullptr) | |
QOAuth2AuthorizationCodeFlow (const QUrl & authenticateUrl , const QUrl & accessTokenUrl , QNetworkAccessManager * manager , QObject * parent = nullptr) | |
QOAuth2AuthorizationCodeFlow (const QString & clientIdentifier , const QUrl & authenticateUrl , const QUrl & accessTokenUrl , QNetworkAccessManager * manager , QObject * parent = nullptr) | |
~QOAuth2AuthorizationCodeFlow () | |
QUrl | accessTokenUrl () const |
void | setAccessTokenUrl (const QUrl & accessTokenUrl ) |
virtual QString | responseType () const override |
virtual void | grant () override |
void | refreshAccessToken () |
void | accessTokenUrlChanged (const QUrl & accessTokenUrl ) |
QUrl | buildAuthenticateUrl (const QVariantMap & 参数 = QVariantMap()) |
void | requestAccessToken (const QString & code ) |
virtual void | resourceOwnerAuthorization (const QUrl & url , const QVariantMap & 参数 = QVariantMap()) override |
The QOAuth2AuthorizationCodeFlow class provides an implementation of the Authorization Code Grant flow.
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.
This property holds the URL used to convert the temporary code received during the authorization response.
另请参阅 : Access Token Request
访问函数:
QUrl | accessTokenUrl () const |
void | setAccessTokenUrl (const QUrl & accessTokenUrl ) |
通知程序信号:
void | accessTokenUrlChanged (const QUrl & accessTokenUrl ) |
构造 QOAuth2AuthorizationCodeFlow object with parent object parent .
构造 QOAuth2AuthorizationCodeFlow object using parent as parent and sets manager as the network access manager.
构造 QOAuth2AuthorizationCodeFlow object using parent as parent and sets manager as the network access manager. The client identifier is set to clientIdentifier .
构造 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 .
构造 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 .
销毁 QOAuth2AuthorizationCodeFlow 实例。
Returns the URL used to request the access token.
注意: Getter 函数对于特性 accessTokenUrl .
另请参阅 setAccessTokenUrl ().
[protected]
QUrl
QOAuth2AuthorizationCodeFlow::
buildAuthenticateUrl
(const
QVariantMap
&
参数
= QVariantMap())
Generates an authentication URL to be used in the Authorization Request 使用 参数 .
[override virtual slot]
void
QOAuth2AuthorizationCodeFlow::
grant
()
重实现自 QAbstractOAuth::grant ().
Starts the authentication flow as described in The OAuth 2.0 Authorization Framework
[slot]
void
QOAuth2AuthorizationCodeFlow::
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.
另请参阅 : Refresh Token
[protected]
void
QOAuth2AuthorizationCodeFlow::
requestAccessToken
(const
QString
&
code
)
Requests an access token from the received code 。 code is received as a response when the user completes a successful authentication in the browser.
[override virtual protected]
void
QOAuth2AuthorizationCodeFlow::
resourceOwnerAuthorization
(const
QUrl
&
url
, const
QVariantMap
&
参数
= QVariantMap())
重实现自 QAbstractOAuth::resourceOwnerAuthorization ().
Builds an authentication URL using url and 参数 . This function emits an authorizeWithBrowser () signal to require user interaction.
[override virtual]
QString
QOAuth2AuthorizationCodeFlow::
responseType
() const
重实现自 QAbstractOAuth2::responseType ().
返回 response_type 用于 QOAuth2AuthorizationCodeFlow ; this is fixed to "code" as required in The OAuth 2.0 RFC
Sets the URL used to request the access token to accessTokenUrl .
注意: Setter 函数对于特性 accessTokenUrl .
另请参阅 accessTokenUrl ().