@briskcloth16/samlify

中文文档
2.13.2发布于 2026/07/24MITTypeScriptCommonJS近 30 天下载 3.3万

Node.js library for SAML SSO

原始使用文档
文档目录8 节
  1. Welcome PRs
  2. Installation
  3. Development
  4. Get Started
  5. Example
  6. Talks
  7. License
  8. Copyright

samlify ·

Build Status npm version NPM Coverage

A fork of https://github.com/tngan/samlify.

Highly configurable Node.js SAML 2.0 library for Single Sign On

Welcome PRs

Welcome all PRs for maintaining this project, or provide a link to the repositories especially for use cases alongside with different frameworks.

Installation

Multiple schema validators are currently supported by our system, with couple validator modules available and the option to create custom ones. It is essential to utilize the setSchemaValidator function at the outset to avoid errors.

import * as samlify from 'samlify';
import * as validator from '@authenio/samlify-xsd-schema-validator';
// import * as validator from '@authenio/samlify-validate-with-xmllint';
// import * as validator from '@authenio/samlify-node-xmllint';

samlify.setSchemaValidator(validator);

Now you can create your own schema validator and even suppress it but you have to take the risk for accepting malicious response.

samlify.setSchemaValidator({
  validate: (response: string) => {
    /* implment your own or always returns a resolved promise to skip */
    return Promise.resolve('skipped');
  }
});

For those using Windows, windows-build-tools should be installed globally before installing samlify if you are using libxml validator.

yarn global add windows-build-tools

Development

This project is now developed using TypeScript, also support Yarn which is a new package manager.

yarn global add typescript
yarn

Get Started

const saml = require('samlify');

See full documentation here

Example

samlify-starter — starter example for getting up and running with samlify

Talks

An introduction to Single Sign On

License

MIT

Copyright (C) 2016-present Tony Ngan, released under the MIT License.

版本与发布记录

@briskcloth16/samlify 共发布 6 个版本,首次发布于 2025/11/30;过去 12 个月发布了 6 个版本。

版本发布日期距今
2.13.2latest2026/07/243 个月前
2.13.12026/06/114 个月前
2.10.52025/12/1710 个月前
2.10.42025/11/3011 个月前
2.10.32025/11/3011 个月前
2.10.22025/11/3011 个月前

关于 @briskcloth16/samlify 的常见问题

@briskcloth16/samlify 是什么?

Node.js library for SAML SSO

如何安装 @briskcloth16/samlify?

在项目目录运行 npm install @briskcloth16/samlify,或使用 pnpm add / yarn add / bun add。

@briskcloth16/samlify 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@briskcloth16/samlify 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@briskcloth16/samlify 可以商用吗?

@briskcloth16/samlify 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@briskcloth16/samlify 的下载量有多少?

根据 npm 官方下载统计,@briskcloth16/samlify 在 2026/10/09 – 2026/11/07 这 30 天内被下载 32,699 次,日均约 1,090 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@briskcloth16/samlify 还在维护吗?

最新版本 2.13.2 发布于 2026/07/24(3 个月前);至今共发布 6 个版本,其中过去 12 个月发布了 6 个;首次发布于 2025/11/30。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。