Commit ae8f4c7a authored by Jesus Fernandez's avatar Jesus Fernandez

URL variable name changed.

parent e3481f18
...@@ -79,7 +79,7 @@ public: ...@@ -79,7 +79,7 @@ public:
void setStatus(QAbstractOAuth::Status status); void setStatus(QAbstractOAuth::Status status);
QUrl authenticateUrl; QUrl authorizationUrl;
QVariantMap extraTokens; QVariantMap extraTokens;
QAbstractOAuth::Status status; QAbstractOAuth::Status status;
QNetworkAccessManager::Operation operation; QNetworkAccessManager::Operation operation;
......
...@@ -73,6 +73,12 @@ public: ...@@ -73,6 +73,12 @@ public:
QOAuth1Private(QNetworkAccessManager *networkAccessManager); QOAuth1Private(QNetworkAccessManager *networkAccessManager);
QString verifier; QString verifier;
QUrl temporaryCredentialsUrl;
QUrl tokenCredentialsUrl;
QOAuth1::Credential clientCredentials;
QOAuth1::Credential token;
QOAuth1::SignatureMethod signatureMethod = QOAuth1::SignatureMethod::Hmac_Sha1;
const QString oauthVersion = QStringLiteral("1.0");
// private slots // private slots
void _q_onTokenRequestFinished(); void _q_onTokenRequestFinished();
...@@ -93,12 +99,6 @@ public: ...@@ -93,12 +99,6 @@ public:
const QOAuth1::Credential &token, const QOAuth1::Credential &token,
const QVariantMap &additionalParameters); const QVariantMap &additionalParameters);
QUrl requestTokenUrl;
QUrl authorizationGrantUrl;
QOAuth1::Credential clientCredentials;
QOAuth1::Credential token;
QOAuth1::SignatureMethod signatureMethod = QOAuth1::SignatureMethod::Hmac_Sha1;
const QString oauthVersion = QStringLiteral("1.0");
QString signatureMethodString() const; QString signatureMethodString() const;
static QString operationName(QNetworkAccessManager::Operation op); static QString operationName(QNetworkAccessManager::Operation op);
......
...@@ -108,18 +108,18 @@ QAbstractOAuth::Status QAbstractOAuth::status() const ...@@ -108,18 +108,18 @@ QAbstractOAuth::Status QAbstractOAuth::status() const
return d->status; return d->status;
} }
QUrl QAbstractOAuth::authorizeUrl() const QUrl QAbstractOAuth::authorizationUrl() const
{ {
Q_D(const QAbstractOAuth); Q_D(const QAbstractOAuth);
return d->authenticateUrl; return d->authorizationUrl;
} }
void QAbstractOAuth::setAuthorizeUrl(const QUrl &url) void QAbstractOAuth::setAuthorizationUrl(const QUrl &url)
{ {
Q_D(QAbstractOAuth); Q_D(QAbstractOAuth);
if (d->authenticateUrl != url) { if (d->authorizationUrl != url) {
d->authenticateUrl = url; d->authorizationUrl = url;
Q_EMIT authorizeUrlChanged(url); Q_EMIT authorizationUrlChanged(url);
} }
} }
......
...@@ -42,10 +42,8 @@ ...@@ -42,10 +42,8 @@
#ifndef QT_NO_HTTP #ifndef QT_NO_HTTP
#include <QtCore/qpair.h>
#include <QtCore/qstring.h> #include <QtCore/qstring.h>
#include <QtCore/qobject.h> #include <QtCore/qobject.h>
#include <QtCore/qvariant.h>
#include <QtNetwork/qnetworkaccessmanager.h> #include <QtNetwork/qnetworkaccessmanager.h>
...@@ -60,6 +58,7 @@ ...@@ -60,6 +58,7 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QUrl; class QUrl;
class QString;
class QByteArray; class QByteArray;
class QNetworkReply; class QNetworkReply;
class QNetworkRequest; class QNetworkRequest;
...@@ -81,8 +80,6 @@ public: ...@@ -81,8 +80,6 @@ public:
Credential(const QString &credentialKey); Credential(const QString &credentialKey);
}; };
virtual ~QAbstractOAuth();
enum class Status { enum class Status {
NotAuthenticated, NotAuthenticated,
TemporaryTokenReceived, TemporaryTokenReceived,
...@@ -95,8 +92,6 @@ public: ...@@ -95,8 +92,6 @@ public:
RequestingAccessToken RequestingAccessToken
}; };
typedef std::function<void(Stage, QVariantMap*)> ModifyParametersFunction;
enum class Error { enum class Error {
NoError, NoError,
NetworkError, NetworkError,
...@@ -107,10 +102,15 @@ public: ...@@ -107,10 +102,15 @@ public:
OAuthCallbackNotVerified OAuthCallbackNotVerified
}; };
typedef std::function<void(Stage, QVariantMap*)> ModifyParametersFunction;
virtual ~QAbstractOAuth();
Status status() const; Status status() const;
QUrl authorizeUrl() const; // Resource Owner Authorization: https://tools.ietf.org/html/rfc5849#section-2.2
void setAuthorizeUrl(const QUrl &url); QUrl authorizationUrl() const;
void setAuthorizationUrl(const QUrl &url);
QVariantMap extraTokens() const; QVariantMap extraTokens() const;
...@@ -129,19 +129,12 @@ public Q_SLOTS: ...@@ -129,19 +129,12 @@ public Q_SLOTS:
virtual void grant() = 0; virtual void grant() = 0;
Q_SIGNALS: Q_SIGNALS:
void granted();
void requestFailed(const Error error); void requestFailed(const Error error);
void statusChanged(Status status); void statusChanged(Status status);
void authorizationUrlChanged(const QUrl &url);
void requestTokenUrlChanged(const QUrl &url);
void authorizationGrantUrlChanged(const QUrl &url);
void authorizeUrlChanged(const QUrl &url);
void extraTokensChanged(const QVariantMap &tokens); void extraTokensChanged(const QVariantMap &tokens);
void authorizationRequested(const QUrl &url);
void authenticationRequested(const QUrl &url);
void granted();
protected: protected:
explicit QAbstractOAuth(QAbstractOAuthPrivate &, QObject *parent = nullptr); explicit QAbstractOAuth(QAbstractOAuthPrivate &, QObject *parent = nullptr);
......
...@@ -307,63 +307,63 @@ QOAuth1::QOAuth1(const Credential &consumerToken, QNetworkAccessManager *manager ...@@ -307,63 +307,63 @@ QOAuth1::QOAuth1(const Credential &consumerToken, QNetworkAccessManager *manager
QOAuth1::~QOAuth1() QOAuth1::~QOAuth1()
{} {}
QUrl QOAuth1::requestTokenUrl() const QOAuth1::Credential QOAuth1::clientCredentials() const
{ {
Q_D(const QOAuth1); Q_D(const QOAuth1);
return d->requestTokenUrl; return d->clientCredentials;
} }
void QOAuth1::setRequestTokenUrl(const QUrl &url) void QOAuth1::setClientCredentials(const QOAuth1::Credential &clientCredentials)
{ {
Q_D(QOAuth1); Q_D(QOAuth1);
if (d->requestTokenUrl != url) { if (d->clientCredentials != clientCredentials) {
d->requestTokenUrl = url; d->clientCredentials = clientCredentials;
Q_EMIT requestTokenUrlChanged(url); Q_EMIT clientCredentialsChanged(clientCredentials);
} }
} }
QUrl QOAuth1::authorizationGrantUrl() const QUrl QOAuth1::temporaryCredentialsUrl() const
{ {
Q_D(const QOAuth1); Q_D(const QOAuth1);
return d->authorizationGrantUrl; return d->temporaryCredentialsUrl;
} }
void QOAuth1::setAuthorizationGrantUrl(const QUrl &url) void QOAuth1::setTemporaryCredentialsUrl(const QUrl &url)
{ {
Q_D(QOAuth1); Q_D(QOAuth1);
if (d->authorizationGrantUrl != url) { if (d->temporaryCredentialsUrl != url) {
d->authorizationGrantUrl = url; d->temporaryCredentialsUrl = url;
Q_EMIT authorizationGrantUrlChanged(url); Q_EMIT temporaryCredentialsUrlChanged(url);
} }
} }
QOAuth1::SignatureMethod QOAuth1::signatureMethod() const QUrl QOAuth1::tokenCredentialsUrl() const
{ {
Q_D(const QOAuth1); Q_D(const QOAuth1);
return d->signatureMethod; return d->tokenCredentialsUrl;
} }
void QOAuth1::setSignatureMethod(QOAuth1::SignatureMethod value) void QOAuth1::setTokenCredentialsUrl(const QUrl &url)
{ {
Q_D(QOAuth1); Q_D(QOAuth1);
if (d->signatureMethod != value) { if (d->tokenCredentialsUrl != url) {
d->signatureMethod = value; d->tokenCredentialsUrl = url;
Q_EMIT signatureMethodChanged(value); Q_EMIT tokenCredentialsUrlChanged(url);
} }
} }
QOAuth1::Credential QOAuth1::clientCredentials() const QOAuth1::SignatureMethod QOAuth1::signatureMethod() const
{ {
Q_D(const QOAuth1); Q_D(const QOAuth1);
return d->clientCredentials; return d->signatureMethod;
} }
void QOAuth1::setClientCredentials(const QOAuth1::Credential &clientCredentials) void QOAuth1::setSignatureMethod(QOAuth1::SignatureMethod value)
{ {
Q_D(QOAuth1); Q_D(QOAuth1);
if (d->clientCredentials != clientCredentials) { if (d->signatureMethod != value) {
d->clientCredentials = clientCredentials; d->signatureMethod = value;
Q_EMIT clientCredentialsChanged(clientCredentials); Q_EMIT signatureMethodChanged(value);
} }
} }
...@@ -457,21 +457,24 @@ QNetworkReply *QOAuth1::requestTokenCredentials(QNetworkAccessManager::Operation ...@@ -457,21 +457,24 @@ QNetworkReply *QOAuth1::requestTokenCredentials(QNetworkAccessManager::Operation
return d->requestToken(operation, url, temporaryCredentials, parameters); return d->requestToken(operation, url, temporaryCredentials, parameters);
} }
QByteArray QOAuth1::generateSignature(const QVariantMap &parameters, const QUrl &url, QNetworkAccessManager::Operation operation) QByteArray QOAuth1::generateSignature(const QVariantMap &parameters,
const QUrl &url,
QNetworkAccessManager::Operation operation)
{ {
Q_D(QOAuth1); Q_D(QOAuth1);
QByteArray signature; QByteArray ret;
if (signatureMethod() == SignatureMethod::Hmac_Sha1) { if (signatureMethod() == SignatureMethod::Hmac_Sha1) {
signature = sign(parameters, url, operation, d->clientCredentials.secret, d->token.secret); ret = signature(parameters, url, operation, d->clientCredentials.secret, d->token.secret);
} else if (signatureMethod() == SignatureMethod::PlainText) { } else if (signatureMethod() == SignatureMethod::PlainText) {
signature.append(d->clientCredentials.key.toUtf8()); ret.append(d->clientCredentials.key.toUtf8());
signature.append('&'); ret.append('&');
signature.append(d->clientCredentials.secret.toUtf8()); ret.append(d->clientCredentials.secret.toUtf8());
} }
return signature; return ret;
} }
void QOAuth1::setup(QNetworkRequest *request, const QVariantMap &signingParameters, void QOAuth1::setup(QNetworkRequest *request,
const QVariantMap &signingParameters,
QNetworkAccessManager::Operation operation) QNetworkAccessManager::Operation operation)
{ {
Q_D(const QOAuth1); Q_D(const QOAuth1);
...@@ -558,9 +561,9 @@ QByteArray QOAuth1::nonce() ...@@ -558,9 +561,9 @@ QByteArray QOAuth1::nonce()
return u.toUtf8(); return u.toUtf8();
} }
QByteArray QOAuth1::signatureBase(const QVariantMap &parameters, QByteArray QOAuth1::signatureBaseString(const QVariantMap &parameters,
const QUrl &url, const QUrl &url,
QNetworkAccessManager::Operation op) QNetworkAccessManager::Operation op)
{ {
QByteArray base; QByteArray base;
...@@ -582,13 +585,13 @@ QByteArray QOAuth1::encodeHeaders(const QVariantMap &headers) ...@@ -582,13 +585,13 @@ QByteArray QOAuth1::encodeHeaders(const QVariantMap &headers)
return QUrl::toPercentEncoding(QString::fromLatin1(parameterString(headers))); return QUrl::toPercentEncoding(QString::fromLatin1(parameterString(headers)));
} }
QByteArray QOAuth1::sign(const QVariantMap &parameters, QByteArray QOAuth1::signature(const QVariantMap &parameters,
const QUrl &url, const QUrl &url,
QNetworkAccessManager::Operation op, QNetworkAccessManager::Operation op,
const QString &consumerSecret, const QString &consumerSecret,
const QString &tokenSecret) const QString &tokenSecret)
{ {
const QByteArray baseString = signatureBase(parameters, url, op); const QByteArray baseString = signatureBaseString(parameters, url, op);
QByteArray secret; QByteArray secret;
secret.append(QUrl::toPercentEncoding(consumerSecret)); secret.append(QUrl::toPercentEncoding(consumerSecret));
...@@ -624,10 +627,10 @@ void QOAuth1::grant() ...@@ -624,10 +627,10 @@ void QOAuth1::grant()
Q_D(QOAuth1); Q_D(QOAuth1);
typedef QOAuth1Private::OAuth1KeyString Key; typedef QOAuth1Private::OAuth1KeyString Key;
if (d->requestTokenUrl.isEmpty()) { if (d->temporaryCredentialsUrl.isEmpty()) {
qCritical("QOAuth1::grant: requestTokenUrl is empty"); qCritical("QOAuth1::grant: requestTokenUrl is empty");
return; return;
} else if (d->authorizationGrantUrl.isEmpty()) { } else if (d->tokenCredentialsUrl.isEmpty()) {
qCritical("QOAuth1::grant: authorizationGrantUrl is empty"); qCritical("QOAuth1::grant: authorizationGrantUrl is empty");
return; return;
} }
...@@ -637,20 +640,20 @@ void QOAuth1::grant() ...@@ -637,20 +640,20 @@ void QOAuth1::grant()
if (d->status == Status::NotAuthenticated) { if (d->status == Status::NotAuthenticated) {
d->setStatus(Status::TemporaryTokenReceived); d->setStatus(Status::TemporaryTokenReceived);
if (!d->authenticateUrl.isEmpty()) { if (!d->authorizationUrl.isEmpty()) {
QVariantMap parameters; QVariantMap parameters;
parameters.insert(Key::oauthToken, d->token.key); parameters.insert(Key::oauthToken, d->token.key);
if (d->modifyParametersFunction) if (d->modifyParametersFunction)
d->modifyParametersFunction(Stage::RequestingAuthorization, &parameters); d->modifyParametersFunction(Stage::RequestingAuthorization, &parameters);
QUrl url = d->authenticateUrl; QUrl url = d->authorizationUrl;
url.setQuery(QAbstractOAuthPrivate::createQuery(parameters)); url.setQuery(QAbstractOAuthPrivate::createQuery(parameters));
Q_EMIT authenticationRequested(url); Q_EMIT authorizationRequested(url);
} }
else { else {
// try upgrading token without verifier // try upgrading token without verifier
requestTokenCredentials(QNetworkAccessManager::PostOperation, requestTokenCredentials(QNetworkAccessManager::PostOperation,
d->authorizationGrantUrl, d->tokenCredentialsUrl,
d->token); d->token);
} }
} else if (d->status == Status::TemporaryTokenReceived) { } else if (d->status == Status::TemporaryTokenReceived) {
...@@ -673,7 +676,7 @@ void QOAuth1::grant() ...@@ -673,7 +676,7 @@ void QOAuth1::grant()
} }
// requesting temporary credentials // requesting temporary credentials
requestTemporaryCredentials(QNetworkAccessManager::PostOperation, d->requestTokenUrl); requestTemporaryCredentials(QNetworkAccessManager::PostOperation, d->temporaryCredentialsUrl);
} }
void QOAuth1::continueGrantWithVerifier(const QString &verifier) void QOAuth1::continueGrantWithVerifier(const QString &verifier)
...@@ -684,7 +687,7 @@ void QOAuth1::continueGrantWithVerifier(const QString &verifier) ...@@ -684,7 +687,7 @@ void QOAuth1::continueGrantWithVerifier(const QString &verifier)
QVariantMap parameters; QVariantMap parameters;
parameters.insert(Key::oauthVerifier, verifier); parameters.insert(Key::oauthVerifier, verifier);
requestTokenCredentials(QNetworkAccessManager::PostOperation, requestTokenCredentials(QNetworkAccessManager::PostOperation,
d->authorizationGrantUrl, d->tokenCredentialsUrl,
d->token, d->token,
parameters); parameters);
} }
......
...@@ -52,7 +52,8 @@ class OAUTH_EXPORT QOAuth1: public QAbstractOAuth ...@@ -52,7 +52,8 @@ class OAUTH_EXPORT QOAuth1: public QAbstractOAuth
Q_OBJECT Q_OBJECT
public: public:
struct OAUTH_EXPORT Credential : QAbstractOAuth::Credential { struct OAUTH_EXPORT Credential : QAbstractOAuth::Credential
{
QString secret; QString secret;
Credential(); Credential();
...@@ -72,27 +73,28 @@ public: ...@@ -72,27 +73,28 @@ public:
explicit QOAuth1(QNetworkAccessManager *manager, explicit QOAuth1(QNetworkAccessManager *manager,
QObject *parent = nullptr); QObject *parent = nullptr);
explicit QOAuth1(const Credential &clientCredentials, QOAuth1(const Credential &clientCredentials,
QNetworkAccessManager *manager, QNetworkAccessManager *manager,
QObject *parent = nullptr); QObject *parent = nullptr);
virtual ~QOAuth1(); virtual ~QOAuth1();
QUrl requestTokenUrl() const; // Client credentials
void setRequestTokenUrl(const QUrl &url); QOAuth1::Credential clientCredentials() const;
void setClientCredentials(const QOAuth1::Credential &clientCredentials);
QUrl authorizationGrantUrl() const; // Temporary Credentials: https://tools.ietf.org/html/rfc5849#section-2.1
void setAuthorizationGrantUrl(const QUrl &url); QUrl temporaryCredentialsUrl() const;
void setTemporaryCredentialsUrl(const QUrl &url);
// Token Credentials: https://tools.ietf.org/html/rfc5849#section-2.3
QUrl tokenCredentialsUrl() const;
void setTokenCredentialsUrl(const QUrl &url);
// Signature method: https://tools.ietf.org/html/rfc5849#section-3.4 // Signature method: https://tools.ietf.org/html/rfc5849#section-3.4
SignatureMethod signatureMethod() const; SignatureMethod signatureMethod() const;
void setSignatureMethod(SignatureMethod value); void setSignatureMethod(SignatureMethod value);
// Client credentials
QOAuth1::Credential clientCredentials() const;
void setClientCredentials(const QOAuth1::Credential &clientCredentials);
// Token credentials: https://tools.ietf.org/html/rfc5849#section-2.3 // Token credentials: https://tools.ietf.org/html/rfc5849#section-2.3
QOAuth1::Credential token() const; QOAuth1::Credential token() const;
void setToken(const QOAuth1::Credential &token); void setToken(const QOAuth1::Credential &token);
...@@ -112,6 +114,8 @@ Q_SIGNALS: ...@@ -112,6 +114,8 @@ Q_SIGNALS:
void signatureMethodChanged(SignatureMethod method); void signatureMethodChanged(SignatureMethod method);
void clientCredentialsChanged(const QOAuth1::Credential &credential); void clientCredentialsChanged(const QOAuth1::Credential &credential);
void tokenChanged(const QOAuth1::Credential &token); void tokenChanged(const QOAuth1::Credential &token);
void temporaryCredentialsUrlChanged(const QUrl &url);
void tokenCredentialsUrlChanged(const QUrl &url);
protected: protected:
QNetworkReply *requestTemporaryCredentials(QNetworkAccessManager::Operation operation, QNetworkReply *requestTemporaryCredentials(QNetworkAccessManager::Operation operation,
...@@ -133,18 +137,20 @@ protected: ...@@ -133,18 +137,20 @@ protected:
static QMap<QString, QString> parseResponse(const QByteArray &response); static QMap<QString, QString> parseResponse(const QByteArray &response);
static QByteArray parameterString(const QVariantMap &parameters); static QByteArray parameterString(const QVariantMap &parameters);
// Nonce: https://tools.ietf.org/html/rfc5849#section-3.3
static QByteArray nonce(); static QByteArray nonce();
static QByteArray encodeHeaders(const QVariantMap &headers); static QByteArray encodeHeaders(const QVariantMap &headers);
static QByteArray generateAuthorizationHeader(const QVariantMap &oauthParams); static QByteArray generateAuthorizationHeader(const QVariantMap &oauthParams);
static QByteArray signatureBase(const QVariantMap &parameters, // Signature Base String: https://tools.ietf.org/html/rfc5849#section-3.4.1
static QByteArray signatureBaseString(const QVariantMap &parameters,
const QUrl &url, const QUrl &url,
QNetworkAccessManager::Operation op); QNetworkAccessManager::Operation op);
static QByteArray sign(const QVariantMap &parameters, // Signature: https://tools.ietf.org/html/rfc5849#section-3.4
const QUrl &url, static QByteArray signature(const QVariantMap &parameters,
QNetworkAccessManager::Operation op, const QUrl &url,
const QString &consumerSecret, QNetworkAccessManager::Operation op,
const QString &tokenSecret); const QString &consumerSecret,
const QString &tokenSecret);
private: private:
Q_DISABLE_COPY(QOAuth1) Q_DISABLE_COPY(QOAuth1)
......
...@@ -163,7 +163,7 @@ QOAuth2AuthorizationCodeFlow::QOAuth2AuthorizationCodeFlow(const QUrl &authentic ...@@ -163,7 +163,7 @@ QOAuth2AuthorizationCodeFlow::QOAuth2AuthorizationCodeFlow(const QUrl &authentic
: QAbstractOAuth2(*new QOAuth2AuthorizationCodeFlowPrivate(manager, port), parent) : QAbstractOAuth2(*new QOAuth2AuthorizationCodeFlowPrivate(manager, port), parent)
{ {
Q_D(QOAuth2AuthorizationCodeFlow); Q_D(QOAuth2AuthorizationCodeFlow);
d->authenticateUrl = authenticateUrl; d->authorizationUrl = authenticateUrl;
d->accessTokenUrl = accessTokenUrl; d->accessTokenUrl = accessTokenUrl;
} }
...@@ -177,7 +177,7 @@ QOAuth2AuthorizationCodeFlow::QOAuth2AuthorizationCodeFlow(const QString &consum ...@@ -177,7 +177,7 @@ QOAuth2AuthorizationCodeFlow::QOAuth2AuthorizationCodeFlow(const QString &consum
{ {
Q_D(QOAuth2AuthorizationCodeFlow); Q_D(QOAuth2AuthorizationCodeFlow);
d->networkAccessManager = manager; d->networkAccessManager = manager;
d->authenticateUrl = authenticateUrl; d->authorizationUrl = authenticateUrl;
d->accessTokenUrl = accessTokenUrl; d->accessTokenUrl = accessTokenUrl;
d->consumer = consumerKey; d->consumer = consumerKey;
} }
...@@ -213,7 +213,7 @@ void QOAuth2AuthorizationCodeFlow::setAccessTokenUrl(const QUrl &accessTokenUrl) ...@@ -213,7 +213,7 @@ void QOAuth2AuthorizationCodeFlow::setAccessTokenUrl(const QUrl &accessTokenUrl)
void QOAuth2AuthorizationCodeFlow::grant() void QOAuth2AuthorizationCodeFlow::grant()
{ {
const QUrl url = buildAuthenticateUrl(); const QUrl url = buildAuthenticateUrl();
Q_EMIT authenticationRequested(url); Q_EMIT authorizationRequested(url);
} }
QUrl QOAuth2AuthorizationCodeFlow::buildAuthenticateUrl(const QVariantMap &parameters) QUrl QOAuth2AuthorizationCodeFlow::buildAuthenticateUrl(const QVariantMap &parameters)
...@@ -224,7 +224,7 @@ QUrl QOAuth2AuthorizationCodeFlow::buildAuthenticateUrl(const QVariantMap &param ...@@ -224,7 +224,7 @@ QUrl QOAuth2AuthorizationCodeFlow::buildAuthenticateUrl(const QVariantMap &param
const QString state = QAbstractOAuth2Private::generateRandomState(); const QString state = QAbstractOAuth2Private::generateRandomState();
QVariantMap p(parameters); QVariantMap p(parameters);
QUrl url(d->authenticateUrl); QUrl url(d->authorizationUrl);
p.insert(Key::responseType, responseType()); p.insert(Key::responseType, responseType());
p.insert(Key::clientId, d->consumer.key); p.insert(Key::clientId, d->consumer.key);
p.insert(Key::redirectUri, callback()); p.insert(Key::redirectUri, callback());
......
...@@ -60,23 +60,23 @@ public: ...@@ -60,23 +60,23 @@ public:
quint16 port = 0, quint16 port = 0,
QObject *parent = nullptr); QObject *parent = nullptr);
explicit QOAuth2AuthorizationCodeFlow(const QString &consumerToken, QOAuth2AuthorizationCodeFlow(const QString &consumerToken,
QNetworkAccessManager *manager, QNetworkAccessManager *manager,
quint16 port = 0, quint16 port = 0,
QObject *parent = nullptr); QObject *parent = nullptr);
explicit QOAuth2AuthorizationCodeFlow(const QUrl &authorizeUrl, QOAuth2AuthorizationCodeFlow(const QUrl &authorizationUrl,
const QUrl &accessTokenUrl, const QUrl &accessTokenUrl,
QNetworkAccessManager *manager, QNetworkAccessManager *manager,
quint16 port = 0, quint16 port = 0,
QObject *parent = nullptr); QObject *parent = nullptr);
explicit QOAuth2AuthorizationCodeFlow(const QString &consumerToken, QOAuth2AuthorizationCodeFlow(const QString &consumerToken,
const QUrl &authorizeUrl, const QUrl &authorizationUrl,
const QUrl &accessTokenUrl, const QUrl &accessTokenUrl,
QNetworkAccessManager *manager, QNetworkAccessManager *manager,
quint16 port = 0, quint16 port = 0,
QObject *parent = nullptr); QObject *parent = nullptr);