npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

verdaccio-openid

v0.18.0

Published

A UI for OIDC authentication for Verdaccio, a fork of verdaccio-github-oauth-ui

Readme

verdaccio-openid

npm npm npm npm

English | 中文

简介

为 Verdaccio 提供 OIDC OAuth 集成的插件,支持浏览器和命令行两种认证方式。

兼容性

  • Verdaccio 5、6、7
  • Node >= 20
  • 支持 ES6 的浏览器

安装

全局安装

npm install -g verdaccio-openid

安装到 Verdaccio 插件目录(高级)

mkdir -p ./install-here/
npm install --global-style \
  --bin-links=false --save=false --package-lock=false \
  --omit=dev --omit=optional --omit=peer \
  --prefix ./install-here/ \
  verdaccio-openid@latest
mv ./install-here/node_modules/verdaccio-openid/ /path/to/verdaccio/plugins/

配置

将以下内容添加到 Verdaccio 配置文件中:

middlewares:
  openid:
    enabled: true

auth:
  openid:
    provider-host: https://example.com
    client-id: CLIENT_ID
    client-secret: CLIENT_SECRET
    username-claim: name
    # scope: openid email groups
    # groups-claim: groups
    # provider-type: gitlab
    # store-type: file
    # store-config: ./store
    # authorized-groups:
    #   - access
    # group-users:
    #   animal:
    #     - tom
    #     - jack

必填选项

| 配置项 | 说明 | | --------------- | ------------------------- | | provider-host | OIDC 提供方的主机地址。 | | client-id | OIDC 提供方的客户端 ID。 | | client-secret | OIDC 提供方的客户端密钥。 |

查看 配置 了解所有可用选项。

OpenID 回调地址

在 OIDC 提供方中配置以下回调地址:

| 流程 | 回调地址 | | --------- | -------------------------------------------------- | | Web Authn | https://your-registry.com/-/oauth/callback/authn | | Web UI | https://your-registry.com/-/oauth/callback | | CLI | https://your-registry.com/-/oauth/callback/cli |

认证

Web UI

配置完成后,点击登录按钮即可直接跳转到 OIDC 提供方进行认证。

如果配置了 auth.htpasswd.file,登录页面会先显示用户名/密码输入框,OIDC 登录按钮显示在下方,允许用户选择任一方式登录。

登录对话框

显式设置 keep-passwd-login 可以覆盖自动检测行为。详见 keep-passwd-login

Web Authn(推荐)

npm login --registry http://your-registry.com

打开浏览器窗口进行 OIDC 登录,成功后自动保存 token。

注意: npm v9+ 默认使用 --auth-type=web。npm v8.14–v8.x 需要显式添加 --auth-type=web。npm < v8.14 使用 legacy 方式:

npm login --auth-type=legacy --registry http://your-registry.com

详见 npm 文档

CLI(备选)

npx verdaccio-openid@latest --registry http://your-registry.com

使用本地回调服务器接收 token。当 Web Authn 不可用时(如旧版 npm)可回退到此方式。详见 CLI 认证

存储后端

为会话状态和缓存选择合适的存储后端:

| 类型 | 适用场景 | | ------------------- | ---------------- | | in-memory(默认) | 单进程、开发环境 | | redis | 多副本部署 | | file | 单节点、持久化 | | dynamodb | 云原生、多副本 |

详见 存储配置 了解各后端的安装说明和所需 peer dependency。

环境变量

所有配置项都可以通过环境变量设置,避免将敏感信息写入配置文件。详见 环境变量 了解命名规则和 dotenv 支持。

贡献

详见 开发指南 了解构建、测试和项目结构。

文档

许可证

MIT