@@ -443,9 +443,8 @@ QNetworkReply *OAuth::postTokenRequest(const QList<QPair<QString, QString>> &que
443
443
req.setAttribute (HttpCredentials::DontAddCredentialsAttribute, true );
444
444
445
445
QUrlQuery arguments;
446
- arguments.setQueryItems (QList<QPair<QString, QString>> { { QStringLiteral (" client_id" ), _clientId },
447
- { QStringLiteral (" client_secret" ), _clientSecret },
448
- { QStringLiteral (" scope" ), Theme::instance ()->openIdConnectScopes () } }
446
+ arguments.setQueryItems (QList<QPair<QString, QString>>{{QStringLiteral (" client_id" ), _clientId}, {QStringLiteral (" client_secret" ), _clientSecret},
447
+ {QStringLiteral (" scope" ), QString::fromUtf8 (QUrl::toPercentEncoding (Theme::instance ()->openIdConnectScopes ()))}}
449
448
<< queryItems);
450
449
req.setUrl (requestTokenUrl);
451
450
return _networkAccessManager->post (req, arguments.toString (QUrl::FullyEncoded).toUtf8 ());
@@ -466,14 +465,12 @@ QUrl OAuth::authorisationLink() const
466
465
467
466
const QByteArray code_challenge = QCryptographicHash::hash (_pkceCodeVerifier, QCryptographicHash::Sha256)
468
467
.toBase64 (QByteArray::Base64UrlEncoding | QByteArray::OmitTrailingEquals);
469
- QUrlQuery query { { QStringLiteral (" response_type" ), QStringLiteral (" code" ) },
470
- { QStringLiteral (" client_id" ), _clientId },
471
- { QStringLiteral (" redirect_uri" ), QStringLiteral (" %1:%2" ).arg (_redirectUrl, QString::number (_server.serverPort ())) },
472
- { QStringLiteral (" code_challenge" ), QString::fromLatin1 (code_challenge) },
473
- { QStringLiteral (" code_challenge_method" ), QStringLiteral (" S256" ) },
474
- { QStringLiteral (" scope" ), Theme::instance ()->openIdConnectScopes () },
475
- { QStringLiteral (" prompt" ), Theme::instance ()->openIdConnectPrompt () },
476
- { QStringLiteral (" state" ), QString::fromUtf8 (_state) } };
468
+ QUrlQuery query{{QStringLiteral (" response_type" ), QStringLiteral (" code" )}, {QStringLiteral (" client_id" ), _clientId},
469
+ {QStringLiteral (" redirect_uri" ), QStringLiteral (" %1:%2" ).arg (_redirectUrl, QString::number (_server.serverPort ()))},
470
+ {QStringLiteral (" code_challenge" ), QString::fromLatin1 (code_challenge)}, {QStringLiteral (" code_challenge_method" ), QStringLiteral (" S256" )},
471
+ {QStringLiteral (" scope" ), QString::fromUtf8 (QUrl::toPercentEncoding (Theme::instance ()->openIdConnectScopes ()))},
472
+ {QStringLiteral (" prompt" ), QString::fromUtf8 (QUrl::toPercentEncoding (Theme::instance ()->openIdConnectPrompt ()))},
473
+ {QStringLiteral (" state" ), QString::fromUtf8 (_state)}};
477
474
478
475
if (!_davUser.isEmpty ()) {
479
476
const QString davUser = QString::fromUtf8 (QUrl::toPercentEncoding (_davUser)); // Issue #7762;
0 commit comments