# sasl-scram-sha-1

> JavaScript implementation of SCRAM-SHA-1 SASL mechanism.

Latest version **1.4.0** (published 2026-02-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install sasl-scram-sha-1
pnpm add sasl-scram-sha-1
yarn add sasl-scram-sha-1
bun add sasl-scram-sha-1
```

## Health

**Score 53/100 (C)** — status: stable.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.4.0 |
| Published | 2026-02-23 |
| First published | 2013-08-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/sasl-scram-sha-1) |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 15.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Lance Stout |
| Maintainers | lancestout, mwild1 |
| Keywords | sasl, auth, authn, authentication, security |

## Links

- npm: https://www.npmjs.com/package/sasl-scram-sha-1
- Repository: https://github.com/mwild1/js-sasl-scram-sha-1
- Homepage: https://github.com/mwild1/js-sasl-scram-sha-1#readme
- Issues: http://github.com/mwild1/js-sasl-scram-sha-1/issues
- npm.io page: https://npm.io/package/sasl-scram-sha-1

## Alternatives

- [@clerk/clerk-expo](https://npm.io/package/@clerk/clerk-expo.md) — 133.6K weekly downloads
- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads

## Recent versions

- 1.4.0 (latest) — 2026-02-23
- 1.3.0 — 2024-07-03
- 1.2.1 — 2017-02-20
- 1.2.0 — 2015-07-13
- 1.1.1 — 2015-02-12
- 1.1.0 — 2014-12-03
- 1.0.1 — 2014-07-15
- 1.0.0 — 2014-07-15
- 0.2.2 — 2014-03-05
- 0.2.1 — 2013-09-19
- 0.2.0 — 2013-09-05
- 0.1.1 — 2013-09-05
- 0.1.0 — 2013-08-07

## README

# SASL : SCRAM-SHA-1

[![Build Status](https://travis-ci.org/otalk/xmpp-uri.png)](https://travis-ci.org/otalk/xmpp-uri)
[![Dependency Status](https://david-dm.org/otalk/xmpp-uri.png)](https://david-dm.org/otalk/xmpp-uri)
[![devDependency Status](https://david-dm.org/otalk/xmpp-uri/dev-status.png)](https://david-dm.org/otalk/xmpp-uri#info=devDependencies)

[![Browser Support](https://ci.testling.com/otalk/xmpp-uri.png)](https://ci.testling.com/otalk/xmpp-uri)


This module is a JavaScript implementation of the SCRAM-SHA-1 SASL mechanism,
which plugs into the [SASL](https://github.com/jaredhanson/js-sasl) framework.

**July 2024:** This repository is a continuation of the development of the
library, which was [archived by the original developer](https://github.com/legastero/js-sasl-scram-sha-1).
Many thanks to Lance for the library and for helping with the transition.

## Installing

```sh
$ npm install sasl-scram-sha-1
```

## Usage

Register the SCRAM-SHA-1 mechanism.

```javascript
factory.use(require('sasl-scram-sha-1'));
```

Send an authentication response with necessary credentials.

```
var mech = factory.create(['SCRAM-SHA-1']);
var initial = mech.response({username: 'chris', password: 'secret'});

var secondResp = mech.challenge('r="XCV234BAL90",s="XMXC234DFS",i=4096')
                     .response({username: 'chris', password: 'secret'});
```

## TODO

Currently missing features:

- Mutual authentication of the server based on the success message.
  

## Credits

  - [Lance Stout](http://github.com/legastero)
  - [Jared Hanson](http://github.com/jaredhanson)
  - [Stephen Paul Weber](https://github.com/singpolyma)

## License

[The MIT License](http://opensource.org/licenses/MIT)

Copyright (c) 2013 Lance Stout <[http://github.com/legasteros/](http://github.com/legastero/)>
Copyright (c) 2012 Jared Hanson <[http://jaredhanson.net/](http://jaredhanson.net/)>
Copyright (c) 2024 Stephen Paul Weber <[https://singpolyma.net/](https://singpolyma.net/)>

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