QOAuth1
QOAuth1
#include <QOAuth1>
Public Functions
| QOAuth1(QObject *parent = nullptr) | |
| QOAuth1(QNetworkAccessManager *manager, QObject *parent = nullptr) | |
| QOAuth1(const QString &clientIdentifier, const QString &clientSharedSecret, QNetworkAccessManager *manager, QObject *parent = nullptr) | |
| QPair<QString, QString> | clientCredentials() const |
| QString | clientSharedSecret() const |
| void | setClientCredentials(const QPair<QString, QString> &clientCredentials) |
| void | setClientCredentials(const QString &clientIdentifier, const QString &clientSharedSecret) |
| void | setClientSharedSecret(const QString &clientSharedSecret) |
| void | setSignatureMethod(QOAuth1::SignatureMethod value) |
| void | setTemporaryCredentialsUrl(const QUrl &url) |
| void | setTokenCredentials(const QPair<QString, QString> &tokenCredentials) |
| void | setTokenCredentials(const QString &token, const QString &tokenSecret) |
| void | setTokenCredentialsUrl(const QUrl &url) |
| void | setTokenSecret(const QString &tokenSecret) |
| QOAuth1::SignatureMethod | signatureMethod() const |
| QUrl | temporaryCredentialsUrl() const |
| QPair<QString, QString> | tokenCredentials() const |
| QUrl | tokenCredentialsUrl() const |
| QString | tokenSecret() const |
Reimplemented Public Functions
| virtual QNetworkReply * | deleteResource(const QUrl &url, const QVariantMap ¶meters = ...) override |
| virtual QNetworkReply * | get(const QUrl &url, const QVariantMap ¶meters = ...) override |
| virtual QNetworkReply * | head(const QUrl &url, const QVariantMap ¶meters = ...) override |
| virtual QNetworkReply * | post(const QUrl &url, const QVariantMap ¶meters = ...) override |
| virtual QNetworkReply * | put(const QUrl &url, const QVariantMap ¶meters = ...) override |
- 21 public functions inherited from QAbstractOAuth
- 34 public functions inherited from QObject
Public Slots
| void | continueGrantWithVerifier(const QString &verifier) |
| virtual void | grant() override |
- 1 public slot inherited from QAbstractOAuth
- 1 public slot inherited from QObject
Signals
| void | clientSharedSecretChanged(const QString &credential) |
| void | signatureMethodChanged(QOAuth1::SignatureMethod method) |
| void | temporaryCredentialsUrlChanged(const QUrl &url) |
| void | tokenCredentialsUrlChanged(const QUrl &url) |
| void | tokenSecretChanged(const QString &token) |
- 11 signals inherited from QAbstractOAuth
- 2 signals inherited from QObject
Protected Functions
| QNetworkReply * | requestTemporaryCredentials(QNetworkAccessManager::Operation operation, const QUrl &url, const QVariantMap ¶meters = ...) |
| QNetworkReply * | requestTokenCredentials(QNetworkAccessManager::Operation operation, const QUrl &url, const QPair<QString, QString> &temporaryToken, const QVariantMap ¶meters = ...) |
| void | setup(QNetworkRequest *request, const QVariantMap &signingParameters, QNetworkAccessManager::Operation operation) |
- 3 protected functions inherited from QAbstractOAuth
- 9 protected functions inherited from QObject
Static Protected Members
| QByteArray | generateAuthorizationHeader(const QVariantMap &oauthParams) |
| QByteArray | nonce() |
详细说明
QOAuth1类提供了OAuth 1协议的实现。
QOAuth1为客户端提供了一种代表资源所有者(例如不同的客户端或最终用户)访问服务器资源的方法。它还为最终用户提供了一个过程,可以使用用户代理重定向授权第三方访问其服务器资源,而无需共享其凭据(通常是用户名和密码对)。
QOAuth1使用令牌来表示由资源所有者授予客户端的授权。通常,在验证资源所有者的身份(通常使用用户名和密码)后,服务器应资源所有者的请求颁发令牌凭据。
在发出临时凭据请求时,客户端仅使用客户端凭据进行身份验证。在发出令牌请求时,客户端使用客户端凭据和临时凭据进行身份验证。一旦客户端接收到并存储了令牌凭证,它就可以通过使用客户端凭证和接收到的令牌凭证进行身份验证请求来代表资源所有者访问受保护的资源。
Indicates the signature method to be used to sign requests.
################################
QQ 3087438119

浙公网安备 33010602011771号