Skip to content

identity: add OAuth2 mTLS authentication - #3940

Open
rm-you wants to merge 3 commits into
gophercloud:mainfrom
rm-you:feat/oauth2-mtls
Open

identity: add OAuth2 mTLS authentication#3940
rm-you wants to merge 3 commits into
gophercloud:mainfrom
rm-you:feat/oauth2-mtls

Conversation

@rm-you

@rm-you rm-you commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Fixes #3915

Adds Identity v3 authentication using OAuth 2.0 mutual TLS client credentials. It obtains an access token from OS-OAUTH2/token, validates it with Keystone to populate the service catalog, and sends it as Authorization: Bearer on service requests. The same flow is used for reauthentication.

ProviderClient now supports authentication headers other than X-Auth-Token; existing authentication methods are unchanged.

Includes unit and acceptance tests.

Links to the line numbers/files in the OpenStack source code that support the code in this PR:

@github-actions github-actions Bot added edit:openstack This PR updates common OpenStack code edit:gophercloud This PR updates common Gophercloud code edit:identity This PR updates identity code labels Aug 12, 2026
@rm-you
rm-you marked this pull request as ready for review August 12, 2026 08:14
@rm-you rm-you changed the title [wip] identity: add OAuth2 mTLS authentication identity: add OAuth2 mTLS authentication Aug 12, 2026
@github-actions github-actions Bot added semver:minor Backwards-compatible change backport-v2 This PR will be backported to v2 labels Aug 18, 2026
@coveralls

coveralls commented Aug 18, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 63.738% (+0.2%) from 63.588% — rm-you:feat/oauth2-mtls into gophercloud:main

@rm-you

rm-you commented Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

@stephenfin I think the Zun failure on both this and #3941 are spurious? Is there a way we can recheck (or is something maybe broken there)?

Sharpz7
Sharpz7 previously approved these changes Sep 2, 2026
rm-you added a commit to rm-you/gophercloud that referenced this pull request Sep 8, 2026
@rm-you

rm-you commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

I don't have permissions to re-run the failed nova CI, but I'm pretty confident it is unrelated, can someone re-trigger that?

@rm-you

rm-you commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main and fixed auth-header precedence: generated headers now precede MoreHeaders/OmitHeaders, so caller overrides and omissions work for both bearer and X-Auth-Token authentication, including retries. The token snapshot used for concurrent reauthentication is preserved. Added regression coverage; the full race suite and lint pass.

@rm-you

rm-you commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Following the validation suggestion in #3942, dd43ced replaces the manual ClientID check with required:"true" and BuildRequestBody, called through ToTokenV3CreateMap; the form-encoded authentication flow is unchanged. Added regression coverage; full race tests and lint pass on Go 1.25.0.

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 edit:identity This PR updates identity code edit:openstack This PR updates common OpenStack code semver:minor Backwards-compatible change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support OAuth 2.0 mutual-TLS client credentials

3 participants