Skip to content

fix: 🐛 send single 'prompt' value so Entra ID OIDC works#918

Open
hoobio wants to merge 1 commit into
opencloud-eu:mainfrom
hoobio:fix/entra-oidc-prompt
Open

fix: 🐛 send single 'prompt' value so Entra ID OIDC works#918
hoobio wants to merge 1 commit into
opencloud-eu:mainfrom
hoobio:fix/entra-oidc-prompt

Conversation

@hoobio
Copy link
Copy Markdown

@hoobio hoobio commented May 23, 2026

Summary

Microsoft Entra ID rejects the authorize call with AADSTS90023: Unsupported 'prompt' value because the desktop client sends two values (select_account consent). Entra accepts only one of login/none/consent/select_account/create. Other IdPs (Keycloak, Okta) are lenient and accept the space-separated form, which is why the bug hasn't surfaced sooner.

The discovery-doc filter in OAuth::fetchWellKnown already narrows _supportedPromtValues against prompt_values_supported, but Entra doesn't publish that field, so the client falls back to the default and the request fails before the browser can complete.

Change

Drop select_account from Theme::openIdConnectPrompt(), keep consent. One-line change in src/libsync/theme.cpp. Entra still shows an account picker on first sign-in to a tenant, and the desktop client's own multi-account wizard covers the "switch accounts" case.

Repro (current behaviour)

https://login.microsoftonline.com/<tenant>/oauth2/v2.0/authorize
  ?response_type=code
  &client_id=<...>
  &redirect_uri=http://127.0.0.1:50404
  &code_challenge=<...>&code_challenge_method=S256
  &scope=openid+offline_access+email+profile
  &prompt=consent+select_account
  &state=<...>
  &login_hint=<user@email>

Response: AADSTS90023: Unsupported 'prompt' value.

Refs

Follow-up (not in this PR)

The hardcoded oauthClientId() (returns "OpenCloudDesktop") only works against IdPs that accept a string client_id, or where the oCIS-side registration endpoint hands the client a dynamic registration. Entra requires a registered app with a GUID client_id, and dynamic registration isn't an option there. That's a separate, larger change (likely an oCIS-side server config field surfaced via the existing well-known/server-config fetch). Happy to scope it as a follow-up PR if there's interest.

Microsoft Entra ID rejects authorization requests with more than one
'prompt' value (AADSTS90023). The OIDC spec allows space-separated
values, and many IdPs (Keycloak, Okta) accept them, but Entra only
accepts one of login/none/consent/select_account/create.

The discovery-doc filter in OAuth::fetchWellKnown already narrows
_supportedPromtValues against 'prompt_values_supported', but Entra
does not publish that field, so the client falls back to the default
'select_account consent' and the authorize call fails.

Drop 'select_account' from the default and send only 'consent'.
Entra still shows an account picker on first sign-in to a tenant.
Multi-account use is already covered by the desktop client's own
account wizard.

Fixes opencloud-eu#871
Refs owncloud/client#8562
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AADSTS90023: Unsupported 'prompt' value when authenticating with Microsoft Entra ID

1 participant