Skip to content

Fix: don't drop requested OIDC scopes not listed in scopes_supported - #932

Merged
soxofaan merged 2 commits into
Open-EO:masterfrom
emmanuelmathot:fix-oidc-entra-scopes
Aug 24, 2026
Merged

Fix: don't drop requested OIDC scopes not listed in scopes_supported #932
soxofaan merged 2 commits into
Open-EO:masterfrom
emmanuelmathot:fix-oidc-entra-scopes

Conversation

@emmanuelmathot

Copy link
Copy Markdown
Contributor

What / why

Fixes #930.

OidcProviderInfo.__init__ was intersecting the scopes an openEO backend declares (e.g. api://<client-id>/openeo) against the discovery document's scopes_supported field. Microsoft Entra ID always reports a fixed, tenant-wide scopes_supported (openid, profile, email, offline_access) regardless of the app's actual custom scopes, so the intersection silently dropped the one scope needed to get a usable access token. No openEO backend behind Entra ID could be authenticated against.

Per @soxofaan comment, this implements option 3 from the issue: stop filtering requested scopes against scopes_supported altogether. It's only a RECOMMENDED, descriptive field per RFC 8414 §2

Changes

  • openeo/rest/auth/oidc.py: OidcProviderInfo now requests {"openid"} | scopes directly, without intersecting against scopes_supported. The offline_access-if-supported behavior for refresh tokens is unchanged.
  • tests/rest/auth/test_oidc.py: added a regression test asserting a requested scope not present in scopes_supported is preserved.
  • CHANGELOG.md: entry under Unreleased / Fixed.

Disclosure

This PR was drafted with the help of Claude Code, per AGENTS.md.

Comment thread openeo/rest/auth/oidc.py Outdated
soxofaan pointed out in review that keeping `_supported_scopes` around
just for gating the "offline_access" refresh-token scope was similarly
unnecessarily cautious as the intersection this PR already removes.
Drop it entirely: "offline_access" is now always requested when a
refresh token is desired, regardless of what the discovery document
advertises.

Open-EO#932 (review)
@soxofaan
soxofaan merged commit a246a72 into Open-EO:master Aug 24, 2026
10 checks passed
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.

Cannot authenticate against a Microsoft Entra ID protected backend: Entra never advertises custom scopes in scopes_supported

2 participants