-
|
Hello npm community! π We're excited to announce that we're bringing OpenID Connect (OIDC) authentication to the npm registry! This new feature will enable more secure, token-less authentication for publishing packages in your CI/CD workflows. What's Coming?OIDC support will allow you to publish npm packages from your CI/CD workflows without managing npm tokens. Your CI/CD provider's identity tokens will authenticate directly with the npm registry, providing:
Initial Platform SupportAt launch, we'll support package publishing from:
We plan to expand support to additional platforms based on community feedback and demand. Timeline
Get Involved!We want to hear from you! This thread is your space to:
Interested in the Private Preview?If you'd like to be considered for the private preview in June, please comment below with:
Stay UpdatedWe'll use this thread to share updates, documentation links, and gather feedback throughout the rollout. Make sure to watch this discussion to stay informed! Looking forward to your feedback and building this together with the community! π The npm Team at GitHub |
Beta Was this translation helpful? Give feedback.
Replies: 22 comments 49 replies
-
|
Super excited for OIDC support on npm! We at Arcjet would love to be part of the private preview in June.
We publish the arcjet-js SDK to npm but don't currently use CI publishing due to security concerns around long-lived tokens. We also want to add build provenance which is easiest using CI publishing.
GitHub Actions.
I think we're up to 33 packages now. We generally publish once or twice per month. |
Beta Was this translation helpful? Give feedback.
-
we'd love to be involved in the preview so we can make sure semantic-release is ready for the public release.
|
Beta Was this translation helpful? Give feedback.
-
out of curiosity, is supporting OIDC for other registries, like Artifactory, part of the plan? |
Beta Was this translation helpful? Give feedback.
-
π Yay! Express interest in joining the private preview
|
Beta Was this translation helpful? Give feedback.
-
|
I would be interested as well in the preview if you need additional tokens
|
Beta Was this translation helpful? Give feedback.
-
|
Please add Azure DevOps to the shortlist of supported CI/CD platforms. π |
Beta Was this translation helpful? Give feedback.
-
|
Will this include using OIDC for fetching/resolving packages from the registry via OIDC? Or just publishing? If just publishing, do you plan to support OIDC for |
Beta Was this translation helpful? Give feedback.
-
|
How do you identify which npm package is allowed to be published by what repo (fork are not allowed to, right?) How do you prevent malicious command injection in a workflow crafting a directory with malware and running |
Beta Was this translation helpful? Give feedback.
-
|
This is great! Will there be a way to restrict packages so that they can only be published through OIDC? That way, even if a maintainer's npm token is compromised, an attacker won't be able to publish unauthorized package versions without write access to the repo |
Beta Was this translation helpful? Give feedback.
-
|
Trusted publishing with OIDC is now generally available! Huge thanks to all those who participated in the private preview and provided feedback, that helped us a lot verifying usage and working on small fixes and improvements before the public release! |
Beta Was this translation helpful? Give feedback.
-
|
Nice one! Would love to get OIDC support for Many packages maintain multiple tags for a release. To support this, I now still need to use an API token and they can't be scoped to |
Beta Was this translation helpful? Give feedback.
-
|
Use Casee: I publish a mix of open-source and private npm packages, and managing long-lived tokens in CI/CD can be risky and tedious. OIDCβs short lived, tokenless approach would be a huge security and convenience boost for my workflows. |
Beta Was this translation helpful? Give feedback.
-
|
To make this really great I think there are some extra developments needed: From the npm side:
From the GitHub / publishing side:
For both:
|
Beta Was this translation helpful? Give feedback.
-
|
Just crossposting my chat with FE from NPM support who also took note of my roadblocks internally (thank you!). I maintain Fontsource that publishes over the
Another nice to have thing which could also harden non-OIDC environments is the ability to programmatically generate short-lived publish tokens that can then be discarded at the end of a CI run. This at least protects us from CI exfiltration attacks if we properly setup token rotation π |
Beta Was this translation helpful? Give feedback.
-
|
As a maintainer of popular project ( For me (I use 2FA to publish with hardware key like YubiKey) adding Trusted Publisher via CI increase risks. Any malware from For instance, can we add a rule to GitHub to allow creating tag only if they were signed by some GPG key (which I will store on hardware key)? (Sorry, if it is a wrong place) |
Beta Was this translation helpful? Give feedback.
-
|
I am working to make use of OIDC for emberjs. I echo some of the requests above (enabling for an entire scope, especially). I also very much would like to be able to have multiple workflows files authorized to publish. We currently publish on tags but also have an automated weekly alpha. Having to merge these workflows makes them both less easy to maintain. |
Beta Was this translation helpful? Give feedback.
-
|
Does anyone else have 404 error when trying to publish with OIDC Trusted Publishing? I'm pretty sure that I configured my Trusted Publisher for GitHub properly, I don't think there's any typo in my package name either and NPM publish works fine... it's kind of frustrating because I can't find what the problem is and the 404 error isn't helpful at all. Side note, I use OTP but even if I disable it, that doesn't seem to make a difference. Do we need to change anything in NPM or GitHub settings to get started? EDIT All resolved thanks for Shegox for helping below, the OIDC form is super confusing, they should seriously improve their documentations. Most of the time that a user gets a 404, it's because of that confusing Trusted Publisher NPM form |
Beta Was this translation helpful? Give feedback.
-
|
When will reusable workflows be supported? |
Beta Was this translation helpful? Give feedback.
-
|
So these NPM authentication and token changes mean our only publishing workflow options henceforth are either switching to OICD Trusted Publishing via GHA or using granular access tokens. The problem with the former is that I wanted to migrate my projects to Codeberg soon (which isn't supported). The problem with the latter is that granular tokens are unsuitable for publishing packages from a large Google-style monorepo, since these tokens are limited to 50 packages only (in addition to time limits). My thi.ng/umbrella repo contains 210 packages. In order to publish them (sometimes all of them will need to be updated), I'd have to first generate multiple granular tokens and then also keep track how many times each token has been used. This adds a lot of extra work and complexity to my monorepo publishing tool. I understand the need for improved NPM security, but as so often, these changes are just poorly thought through (IMO) and continuously add new workloads and complexity on already stretched maintainers... |
Beta Was this translation helpful? Give feedback.
-
|
We, same as here, have repositories that have multiple workflow files to publish packages. The current settings do only allow 1 filename. @leobalter Would it be an option to make either the file name or the environments mandatory, instead of having only the file name mandatory? |
Beta Was this translation helpful? Give feedback.
-
|
How is this workflow supposed to work for new packages, if one has to first to manually create a "Trusted Publisher" config via package settings on npmjs.com, which will obviously only not work for entirely new packages? This all feels not very well thought through, or rather only seems to have considered some very basic use cases and not collected feedback from maintainers of larger projects. The entire approach is hostile to all maintainers responsible for dozens/hundreds/thousands of packages (same goes for the arbitrarily chosen useless 50 packages-per-token-limit of granular tokens). If there's some feasible solution for publishing larger numbers of packages, at the very least please update the relevant docs... |
Beta Was this translation helpful? Give feedback.
-
|
Any updates on when npm OICD will be available for Bitbucket pipelines? |
Beta Was this translation helpful? Give feedback.


Trusted publishing with OIDC is now generally available!
Huge thanks to all those who participated in the private preview and provided feedback, that helped us a lot verifying usage and working on small fixes and improvements before the public release!