Replies: 1 comment
-
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
🏷️ Discussion Type
Bug
Body
Current Behavior
OIDC token exchange fails with
401 Unauthorizedwhen the GitHub Enterprise hasinclude_enterprise_slug(docs) enabled on the OIDC issuer.The OIDC token's
issclaim ishttps://token.actions.githubusercontent.com/<enterprise-slug>(enterprise-scoped) instead ofhttps://token.actions.githubusercontent.com(standard). The npm registry rejects the token because it only trusts the standard issuer URL.All other claims are correct:
repository,repository_owner,job_workflow_ref, andenvironmentall match the trusted publisher configuration on npmjs.com.Expected Behavior
The npm registry should accept OIDC tokens from enterprise-scoped GitHub Actions issuers (
https://token.actions.githubusercontent.com/<enterprise-slug>).These enterprise-scoped issuers share the same JWKS signing keys as the standard issuer, and the enterprise slug can be validated against the
enterpriseclaim in the JWT.GitHub Enterprise Cloud customers enable
include_enterprise_slugas a security best practice to scope OIDC tokens for cloud providers (AWS, Azure, GCP). Disabling it to use npm trusted publishing degrades security posture for all other OIDC consumers, this is not an acceptable trade-off.The identical problem exists on PyPI: pypi/warehouse#17700
Steps To Reproduce
include_enterprise_slugenabledid-token: writepermission that callsnpm publishissclaim ishttps://token.actions.githubusercontent.com/<enterprise-slug>instead ofhttps://token.actions.githubusercontent.comThe key OIDC token claims from a debug run confirm the issue,
issis enterprise-scoped (https://token.actions.githubusercontent.com/<enterprise-slug>) withissuer_scope: enterprise, while all other claims (repository,repository_owner,job_workflow_ref,aud) are correct and match the trusted publisher configuration.Suggested fix: accept issuer URLs matching
https://token.actions.githubusercontent.com/<slug>and optionally validate theenterpriseclaim matches the slug. The enterprise-scoped issuers share the same JWKS signing keys as the standard issuer.Environment
npm: 11.12.1
Node.js: v24.14.1
OS: Ubuntu (GitHub Actions, ubuntu-latest)
Runner: GitHub-hosted
actions/setup-node: v6.1.0
Package: scoped (@org/package)
Beta Was this translation helpful? Give feedback.
All reactions