fix(hf-auth): force OAuth consent prompt to expose org grants#1092
Open
tfrere wants to merge 1 commit into
Open
fix(hf-auth): force OAuth consent prompt to expose org grants#1092tfrere wants to merge 1 commit into
tfrere wants to merge 1 commit into
Conversation
Pass `prompt=consent` on the HuggingFace authorization URL so the consent screen is displayed on every login, even when the app has already been authorized. This is needed because HF lets the user pick which organizations to grant `read-repos` to during the consent step. A user who skipped that step the first time (or who joined an org *after* the initial login) had no in-app way to fix it: the only options were to manually revoke the app at https://huggingface.co/settings/connected-applications or edit the OAuth grants by hand. With this change, "Sign out + Sign in" is enough to re-open the org checkbox list, which is the common path users hit when private apps from organizations like `pollen-robotics` fail to appear in the app catalog. The OAuth scopes are unchanged: `read-repos` already covers org repos when the user has explicitly granted org-level access. No additional scope is required. Co-authored-by: Cursor <cursoragent@cursor.com>
pierre-rouanet
approved these changes
May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Reported by a user who is a member of
pollen-robotics: he sees his own private Spaces taggedreachy_mini_python_appin the app catalog, but never the private ones frompollen-robotics. The desktop app's catalog (which callsHfApi.list_spaces(filter=..., token=token)from the daemon) returns user-private repos correctly, so auth and tagging are fine. The blocker is HF-side: the OAuth token does not have org-level grants.Root cause
Per HF OAuth docs:
Our
read-reposscope is already sufficient. The user just has to tickpollen-robotics(or any other org) in the HF consent screen during the OAuth flow. The problem: the consent screen is only displayed on the first authorization. A user who skipped the org checkbox initially (or joined the org afterwards) has no in-app way to fix it, short of manually revoking the app at https://huggingface.co/settings/connected-applications.Change
Add
prompt=consentto the HuggingFace authorization URL increate_oauth_session. This is a standard OIDC parameter that forces the consent screen to be redisplayed on every login, even when the app has already been authorized. The user can then (re-)pick which orgs to grant access to, without having to revoke anything by hand.The OAuth scopes are unchanged.
What this does NOT fix
Two things still need to be checked org-side:
pollen-roboticsorg admins must have authorized the OAuth app71146982-8184-45a2-b05a-d561b3cd701dfor the org (Settings -> Connected applications). Without this, even consent + tick won't work.reachy_mini_python_apptag in their README, otherwise they won't pass thefilter=query against/api/spaces.Test plan
reachy_mini_python_appshow up in the catalog.Made-with: Cursor
Made with Cursor