@j2inn/scram
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

TypeScript client SCRAM authentication library

This library is used by clients wanting to authenticate with servers that use SCRAM (Salted Challenge Response Authentication Mechanism).

For more information on SCRAM, please see the specification.

Installation

npm install @j2inn/scram

Use

import authenticate from '@j2inn/scram'

...

async function onAuthenticate(username: string, password: string): void {
  await authenticate({
    username,
    password,
    uri: new URL('/auth', window.location.href)
  })
}

An alternative fetch parameter can be specified if this library is used in a NodeJS environment...

import fetch from 'node-fetch'
import authenticate from '@j2inn/scram'

...

async function onAuthenticate(username: string, password: string, uri: string): void {
  await authenticate({
    username,
    password,
    fetch,
    uri
  })
}

Links

Package Sidebar

Install

npm i @j2inn/scram

Weekly Downloads

1,955

Version

1.0.6

License

ISC

Unpacked Size

41.1 kB

Total Files

7

Last publish

Collaborators

  • elitescientist
  • hecsalazarf
  • jaxgzz
  • greta.d
  • chrismarshall
  • christiang
  • garethj99
  • shal1y
  • quinatzins
  • hishame
  • j2aarons
  • riccardol
  • sarahp
  • noerojas
  • ionute
  • matteoz