Skip to content

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

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

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

Conversation

@hoobio

@hoobio hoobio commented May 23, 2026

Copy link
Copy Markdown

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 #871
Refs owncloud/client#8562
@guruz

guruz commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

@rhafer FYI ^

@hoobio Did you try how OpenCloud iOS and Android app behave?

@TheOneRing

Copy link
Copy Markdown
Contributor

We have that consent in there for a reason.
Please open a feature request for Entra ID support.

@guruz

guruz commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Linking opencloud-eu/ios#65

@guruz

This comment was marked as off-topic.

@guruz

guruz commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Linking opencloud-eu/ios#65

@hoobio Do you have. iOS by any chance? Could you please try this with the 1.2.4, Build (5) testing build from Testflight? Please report back.
https://testflight.apple.com/join/2F5wWTGV

@guruz

guruz commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

prompt_values_supported, but Entra doesn't publish that field

Drop select_account from Theme::openIdConnectPrompt(), keep consent.

Superseded by #1092

Related: @hoobio Maybe document what you had to do server side in opencloud-eu/opencloud#3051 ?

guruz added a commit to opencloud-eu/ios-sdk that referenced this pull request Oct 29, 2026
This semi-aligns to desktop app which uses 'consent' as fallback if there is
no prompt_values_supported.
The iOS client should probably also parse prompt_values_supported.

Relates to opencloud-eu/desktop#918
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

3 participants