desk-multipass
v0.0.6
Published
Desk.com Multipass SSO
Downloads
5
Readme
Desk.com Multipass SSO module
Simple module for Desk.com's Multipass SSO.
Install
npm install desk-multipass
Usage (with express)
var url = require('url');
var multipass = new require('desk-multipass')(SITEKEY, APIKEY);
app.get('/desk', function (req, res, next) {
// check if user is logged in
multipass.create({
uid: '1',
expires: new Date(new Date().getTime() + (1000 * 60)),
customer_email: '[email protected]',
customer_name: 'Alex Ahn'
}, function (err, hash, signature) {
var multipassUrlObj, multipassUrl;
if (err) return next(err);
multipassUrlObj = {
protocol: 'http',
host: 'test.desk.com',
pathname: '/customer/authentication/multipass/callback',
query: {
multipass: hash,
signature: signature
}
};
multipassUrl = url.format(multipassUrlObj);
res.redirect(multipassUrl);
});
});