@@ -420,9 +420,8 @@ QNetworkReply *OAuth::postTokenRequest(const QList<QPair<QString, QString>> &que
420
420
req.setAttribute (HttpCredentials::DontAddCredentialsAttribute, true );
421
421
422
422
QUrlQuery arguments;
423
- arguments.setQueryItems (QList<QPair<QString, QString>> { { QStringLiteral (" client_id" ), _clientId },
424
- { QStringLiteral (" client_secret" ), _clientSecret },
425
- { QStringLiteral (" scope" ), Theme::instance ()->openIdConnectScopes () } }
423
+ arguments.setQueryItems (QList<QPair<QString, QString>>{{QStringLiteral (" client_id" ), _clientId}, {QStringLiteral (" client_secret" ), _clientSecret},
424
+ {QStringLiteral (" scope" ), QString::fromUtf8 (QUrl::toPercentEncoding (Theme::instance ()->openIdConnectScopes ()))}}
426
425
<< queryItems);
427
426
req.setUrl (requestTokenUrl);
428
427
return _networkAccessManager->post (req, arguments.toString (QUrl::FullyEncoded).toUtf8 ());
@@ -443,14 +442,12 @@ QUrl OAuth::authorisationLink() const
443
442
444
443
const QByteArray code_challenge = QCryptographicHash::hash (_pkceCodeVerifier, QCryptographicHash::Sha256)
445
444
.toBase64 (QByteArray::Base64UrlEncoding | QByteArray::OmitTrailingEquals);
446
- QUrlQuery query { { QStringLiteral (" response_type" ), QStringLiteral (" code" ) },
447
- { QStringLiteral (" client_id" ), _clientId },
448
- { QStringLiteral (" redirect_uri" ), QStringLiteral (" %1:%2" ).arg (_redirectUrl, QString::number (_server.serverPort ())) },
449
- { QStringLiteral (" code_challenge" ), QString::fromLatin1 (code_challenge) },
450
- { QStringLiteral (" code_challenge_method" ), QStringLiteral (" S256" ) },
451
- { QStringLiteral (" scope" ), Theme::instance ()->openIdConnectScopes () },
452
- { QStringLiteral (" prompt" ), Theme::instance ()->openIdConnectPrompt () },
453
- { QStringLiteral (" state" ), QString::fromUtf8 (_state) } };
445
+ QUrlQuery query{{QStringLiteral (" response_type" ), QStringLiteral (" code" )}, {QStringLiteral (" client_id" ), _clientId},
446
+ {QStringLiteral (" redirect_uri" ), QStringLiteral (" %1:%2" ).arg (_redirectUrl, QString::number (_server.serverPort ()))},
447
+ {QStringLiteral (" code_challenge" ), QString::fromLatin1 (code_challenge)}, {QStringLiteral (" code_challenge_method" ), QStringLiteral (" S256" )},
448
+ {QStringLiteral (" scope" ), QString::fromUtf8 (QUrl::toPercentEncoding (Theme::instance ()->openIdConnectScopes ()))},
449
+ {QStringLiteral (" prompt" ), QString::fromUtf8 (QUrl::toPercentEncoding (Theme::instance ()->openIdConnectPrompt ()))},
450
+ {QStringLiteral (" state" ), QString::fromUtf8 (_state)}};
454
451
455
452
if (!_davUser.isEmpty ()) {
456
453
const QString davUser = QString::fromUtf8 (QUrl::toPercentEncoding (_davUser)); // Issue #7762;
0 commit comments