Skip to content

System config OIDC: Prompt is read from the Ports key instead of the Prompt key #12557

Description

@DeepDiver1975

Summary

In AppConfig::loadOpenIdConfigFromSystemConfig() (src/libsync/config/appconfig.cpp, branch 7.1), the OpenID Connect Prompt value is read from the Ports settings key instead of the Prompt key:

OpenIdConfig AppConfig::loadOpenIdConfigFromSystemConfig(const QSettings &system)
{
    QString clientId = system.value(OidcClientIdKey, QString()).toString();
    QString clientSecret = system.value(OidcClientSecretKey, QString()).toString();
    QString scopes = system.value(OidcScopesKey, QString()).toString();
    QString prompt = system.value(OidcPortsKey, QString()).toString();   // <-- bug: should be OidcPromptKey
    ...
}

The keys are defined as:

inline static const QString OidcPortsKey  = QStringLiteral("OpenIDConnect/Ports");
inline static const QString OidcPromptKey = QStringLiteral("OpenIDConnect/Prompt");

OidcPromptKey is therefore never used to read the prompt.

Impact

When OpenID Connect is configured through the system configuration ([OpenIDConnect] section / registry), the administrator-provided Prompt value is ignored. Instead, prompt is populated with the raw string value of the Ports setting (e.g. "8080,8443"), which is not a valid OIDC prompt parameter.

Because a valid system OIDC config fully replaces the built-in/theme OIDC config (if (systemConfig.isValid()) _openIdConfig = systemConfig;), there is no fallback — the configured prompt is effectively unreachable via system configuration.

Expected

QString prompt = system.value(OidcPromptKey, QString()).toString();

Notes

Found while verifying the documentation for the 7.1 "System Configuration" feature (docs-client-desktop#718). A prompt-handling test for loadOpenIdConfigFromSystemConfig() would catch this.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions