1.0.2 • Published 2 years ago

simple-sasl v1.0.2

Weekly downloads
5
License
MIT
Repository
github
Last release
2 years ago

Description

Simple SASL is a nodejs module to check PLAIN authentication against a SASL server. At the moment only PLAIN method is supported.

Options

FieldTypeDefaultDescription
hoststringmandatorySASL server host
portnumbermandatorySASL server port
userstringmandatoryUsername we want to authenticate
passwordstringmandatoryPassword for authentication
methodstringmandatoryOnly "plain" is accepted
ripstringremote addressRemote IP address
lipstringlocal addressLocal IP address
servicestringimapType of service
securedbooleanfalseIf the connection is secured
nologinbooleanfalseIf we do not perform login
debugbooleanfalsePrint debug information

Install

npm install simple-sasl

Usage

const sasl = require("simple-sasl");

sasl.authenticate(
  {
    host: "xxx.xxx.xxx.xxx",
    port: 12345,
    user: "myname@domain.com",
    password: "MyPassword",
    rip: "xxx.xxx.xxx.xxx",
    service: smtp,
    nologin: true,
    secured: true,
    method: "plain",
  },
  function (err) {
    if (err) {
      console.log(err);
    } else {
      console.log("OK, authenticated!");
    }
  }
);