Authentication with Squiz Matrix from Node.js
var matrixAuth = ;var auth =;auth;auth;
var matrixAuth = ;
opts object is used to pass configuration to
opts.auth: The user credentials you wish to authenticate with in the form of 'user:pass'.
opts.admin: The Admin URI of a Matrix system.
opts.wsdl: The URI of a configured SOAP API.
The optional callback
cb(err, data) is called when either the
success event is fired.
The private method
true if authentication was successful.
matrixAuth returns an instance of
EventEmitter, and exposes the following events:
data.auth: The user authentication information
data.admin: The result of passing opts.admin into url.parse
data.wsdl: The result of passing opts.wsdl into url.parse
data.nonce: The nonce token used to sign certain requests to Matrix.
data.cookie: The session cookie used to sign requests to Matrix.
data.sessionId: The ID assigned to the authenticated session.
data.sessionKey: The key assigned to the authenticated session.
error event returns an Error object and is fired if an error occurs during authentication.
npm install node-matrix-auth