summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@remarkable.com>2020-10-19 09:45:56 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2020-10-19 13:18:51 +0000
commitc7dba0796324c9846ffb9dac470045da35520337 (patch)
treeb78838ecc8dd5a2d81588f8c41e659959f6cd558
parent6bfbe5ceeb692ca96e43222327edb75b52b6a319 (diff)
Add client id and shared secret to token refresh requests
In order to refresh the authorization based on a refresh token the server needs to know for which client the refresh is made. At least Google refuses to do anything without these, after this change the refresh is successful. [ChangeLog][OAuth2] Fixed starting a new session with some servers (e.g. Google) when using a refresh token. Fixes: QTBUG-87703 Change-Id: I1fd123d223aed0894743e6d9b3eba27da143a030 Reviewed-by: Jesus Fernandez <jsfdez@gmail.com> (cherry picked from commit a7d697498be7d19bd86d343474845febc9f46b68) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/oauth/qoauth2authorizationcodeflow.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/oauth/qoauth2authorizationcodeflow.cpp b/src/oauth/qoauth2authorizationcodeflow.cpp
index 4c23c97..a1075a5 100644
--- a/src/oauth/qoauth2authorizationcodeflow.cpp
+++ b/src/oauth/qoauth2authorizationcodeflow.cpp
@@ -317,6 +317,8 @@ void QOAuth2AuthorizationCodeFlow::refreshAccessToken()
parameters.insert(Key::grantType, QStringLiteral("refresh_token"));
parameters.insert(Key::refreshToken, d->refreshToken);
parameters.insert(Key::redirectUri, QUrl::toPercentEncoding(callback()));
+ parameters.insert(Key::clientIdentifier, d->clientIdentifier);
+ parameters.insert(Key::clientSharedSecret, d->clientIdentifierSharedKey);
if (d->modifyParametersFunction)
d->modifyParametersFunction(Stage::RefreshingAccessToken, &parameters);
query = QAbstractOAuthPrivate::createQuery(parameters);