You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
auth: application credentials should not send a scope in token requests #3868
When authenticating with application credentials, ToTokenV3ScopeMap still builds and returns a project scope from AuthScope (or from the TenantID/TenantName backwards-compatibility fallback). Keystone rejects this with HTTP 401:
Application credentials cannot request a scope.
This is because application credentials carry an implicit project scope baked into the credential at creation time. Sending an explicit scope alongside them is an error per the Keystone spec.
The plugin raises ApplicationCredentialAuthError when a scope is provided alongside application credentials.
Expected behaviour
ToTokenV3ScopeMap should return an empty map when ApplicationCredentialID or ApplicationCredentialName is set, so that no scope key is included in the token request body.
Proposed fix
Add an early-return guard at the top of ToTokenV3ScopeMap:
This mirrors the behaviour of the existing unit tests in openstack/identity/v3/tokens/testing/requests_test.go (e.g. TestCreateApplicationCredentialIDAndSecret) which already pass nil scope and expect no scope in the JSON body — but those tests use tokens.AuthOptions, not gophercloud.AuthOptions, so the bug only surfaces when the top-level AuthOptions is used with a populated Scope field or TenantID/TenantName.
Activity
winiciusallan commentedon Jul 24, 2026
FWIW, the source code reference might be this one, right?
https://github.com/openstack/keystone/blob/30ef2ffa65a3486ef882f00538e20f2253c57d4c/keystone/auth/core.py#L280-L284
auth: don't send scope with application credentials
auth: don't send scope with application credentials