fix oidc connector scope parsing in case of QT >= 9.0

This commit is contained in:
Jehan Monnier 2025-07-07 17:28:20 +02:00 committed by Gaelle Braud
parent 5a956ff655
commit 3240f0f757

View file

@ -81,7 +81,7 @@ OIDCModel::OIDCModel(const std::shared_ptr<linphone::AuthInfo> &authInfo, QObjec
mOidc.setClientIdentifierSharedKey(clientSecret->getPassword().c_str());
}
QSet<QByteArray> scopeTokens = {OIDCScope};
QSet<QByteArray> scopeTokens;
if (autorizationUrl.hasQuery()) {
QUrlQuery query(autorizationUrl);
if (query.hasQueryItem("scope")) {
@ -91,6 +91,11 @@ OIDCModel::OIDCModel(const std::shared_ptr<linphone::AuthInfo> &authInfo, QObjec
}
}
}
if (scopeTokens.isEmpty()) {
scopeTokens.insert(OIDCScope);
qDebug() << "No scope found in authorization URL, using default scope [" << OIDCScope << "]";
}
#if QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)
mOidc.setRequestedScopeTokens(scopeTokens);
#else