# samlify

> Node.js library for SAML SSO

Latest version **2.15.1** (published 2026-10-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install samlify
pnpm add samlify
yarn add samlify
bun add samlify
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 2.15.1 |
| Published | 2026-10-21 |
| First published | 2017-06-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 538.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 664 |
| Author | tngan |
| Maintainers | tngan |
| Keywords | nodejs, saml2, sso, slo, metadata |

## Links

- npm: https://www.npmjs.com/package/samlify
- Repository: https://github.com/tngan/samlify
- Homepage: https://github.com/tngan/samlify#readme
- Issues: https://github.com/tngan/samlify/issues
- npm.io page: https://npm.io/package/samlify

## Dependencies (6)

- [xml](https://npm.io/package/xml.md) ^1.0.1
- [xpath](https://npm.io/package/xpath.md) ^0.0.35
- [xml-crypto](https://npm.io/package/xml-crypto.md) ^6.4.0
- [xml-escape](https://npm.io/package/xml-escape.md) ^1.1.0
- [@xmldom/xmldom](https://npm.io/package/@xmldom/xmldom.md) ^0.9.12
- [@authenio/xml-encryption](https://npm.io/package/@authenio/xml-encryption.md) ^6.0.2

## Recent versions

- 2.15.1 (latest) — 2026-10-21
- 2.15.0 — 2026-10-20
- 2.14.0 — 2026-10-17
- 2.13.1 — 2026-05-18
- 2.13.0 — 2026-05-14
- 2.12.0 — 2026-03-31
- 2.11.0 — 2026-03-09
- 2.10.2 — 2025-11-28
- 2.10.1 — 2025-07-06
- 2.10.0 — 2025-05-06
- 2.9.1 — 2025-03-24
- 2.9.0 — 2025-03-15
- 2.8.11 — 2024-03-02
- 2.8.10 — 2023-02-26
- 2.8.9 — 2023-02-14
- … 60 more at https://npm.io/package/samlify/versions

## README

# samlify

[![Build Status](https://img.shields.io/circleci/build/github/tngan/samlify?style=for-the-badge&logo=circleci)](https://app.circleci.com/pipelines/github/tngan/samlify)
[![npm version](https://img.shields.io/npm/v/samlify.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/samlify)
[![NPM](https://img.shields.io/npm/dm/samlify.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/samlify)
[![Coverage](https://img.shields.io/badge/coverage-%E2%89%A590%25-brightgreen?style=for-the-badge&logo=vitest)](./vitest.config.ts)

Node.js library for SAML SSO

### Installation

```console
npm install samlify
```

### Schema validation

samlify validates every incoming SAML message against the XML schema, so register a schema validator before anything else. Pick one of the validator modules:

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

samlify.setSchemaValidator(validator);
```

You can also supply your own validator. Skipping validation means accepting messages that may be malicious, so only do this if you understand the risk:

```typescript
samlify.setSchemaValidator({
  validate: (response: string) => {
    /* implement your own, or always resolve to skip validation */
    return Promise.resolve('skipped');
  }
});
```

### Get Started

```javascript
const saml = require('samlify');
```

See the full documentation [here](https://samlify.js.org/).

### Example

[samlify-starter](https://github.com/tngan/samlify-starter) — starter example for getting up and running with samlify

### Development

```console
yarn
yarn test
```

PRs are welcome, as are links to examples that use samlify with other frameworks. See [CONTRIBUTING.md](CONTRIBUTING.md).

### Talks

[An introduction to Single Sign On](https://www.slideshare.net/TonyNgan/an-introduction-of-single-sign-on)

### License

[MIT](LICENSE)

### Copyright

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

---
_Source: https://npm.io/package/samlify · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
