Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

drachtio-mw-auth-parser

0.1.0 • Public • Published

drachtio-mw-auth-parser Build Status NPM version

drachtio middleware for parsing SIP Authorization header, supporting Digest and Basic authorization

Usage

const Srf = require('drachtio-srf');
const srf = new Srf();
const authParser = require('drachtio-mw-auth-parser') ;
 
srf.connect({...}) ;
 
srf.use(authParser) ;
 
srf.register(( req, res ) => {
  console.log(req.authorization) ;
  /*
    Digest: username="103482",realm="sip.drachtio.org",nonce="df24fd41-4fc5-416f-b163-90f774ca0358" \
      uri="sip:73.15.46.10:6060",algorithm=MD5,response="a4881ad854cc0677158206ac9fa90e3b", \
      qop=auth,nc=00000032,cnonce="ea5cec20"
 
    console.log =>
    {
      scheme: 'digest',
      username: '103482',
      realm: 'sip.drachtio.org',
      nonce: 'df24fd41-4fc5-416f-b163-90f774ca0358',
      uri: 'sip:72.1.46.10:6060',
      algorithm: 'MD5',
      response: 'a4881ad854cc0677158206ac9fa90e3b',
      qop: 'auth',
      nc: '00000032',
      cnonce: 'ea5cec20'
    }
   */
}) ;

Install

npm i drachtio-mw-auth-parser

DownloadsWeekly Downloads

3

Version

0.1.0

License

MIT

Unpacked Size

9.19 kB

Total Files

10

Last publish

Collaborators

  • avatar