Skip to content

auth: don't send scope with application credentials - #3869

Merged
stephenfin merged 3 commits into
gophercloud:mainfrom
fwiesel:fix/app-cred-scope
Aug 7, 2026
Merged

stephenfin merged 3 commits into
gophercloud:mainfrom
fwiesel:fix/app-cred-scope

Conversation

@fwiesel

@fwiesel fwiesel commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Fixes #3868

When authenticating with application credentials, ToTokenV3ScopeMap was including a project scope in the token request. Keystone rejects this with HTTP 401: Application credentials cannot request a scope.

Application credentials carry an implicit project scope already. The fix returns an empty scope map early when application credentials are present.

Links to OpenStack source confirming that scopes are rejected with application credentials:
https://opendev.org/openstack/keystone/src/branch/stable/2025.1/keystone/auth/plugins/application_credential.py

Keystone returns 401 when a token request includes both application
credentials and an explicit scope. Application credentials carry an
implicit project scope already.

For gophercloud#3868
@github-actions github-actions Bot added edit:gophercloud This PR updates common Gophercloud code semver:patch No API change backport-v2 This PR will be backported to v2 labels Jul 22, 2026
@coveralls

coveralls commented Jul 22, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 63.498% (-0.05%) from 63.543% — fwiesel:fix/app-cred-scope into gophercloud:main

kayrus
kayrus previously approved these changes Jul 22, 2026
Comment thread auth_options.go Outdated

@winiciusallan winiciusallan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per what is done in Keystone source code[1], I think this is consistent and looks correct.

https://github.com/openstack/keystone/blob/30ef2ffa65a3486ef882f00538e20f2253c57d4c/keystone/auth/core.py#L280-L284

Comment thread auth_options.go Outdated
@github-actions github-actions Bot added semver:minor Backwards-compatible change and removed semver:patch No API change labels Jul 24, 2026
Comment thread testing/auth_options_test.go Outdated
Comment thread testing/auth_options_test.go Outdated
@stephenfin
stephenfin added this pull request to the merge queue Aug 7, 2026
Merged via the queue into gophercloud:main with commit 9797ca7 Aug 7, 2026
70 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-v2 This PR will be backported to v2 edit:gophercloud This PR updates common Gophercloud code semver:minor Backwards-compatible change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

auth: application credentials should not send a scope in token requests

5 participants