this module is nice!! Given the code included how would I go about getting a
function that returns req.connection.user without using app.use etc?
I want to do this in app.js. I have tried a dozen different ways but I am
hitting a wall. THanks
function GetUserName() {
}
'use strict';
var express = require('express');
var app = express();
var server = require('http').createServer(app);
app.use(function (req, res, next) {
var nodeSSPI = require('node-sspi');
var nodeSSPIObj = new nodeSSPI({
retrieveGroups: true
});
nodeSSPIObj.authenticate(req, res, function(err){
res.finished || next();
});
});
app.use(function (req, res, next) {
var out = 'Hello ' + req.connection.user + '! You belong to following
groups:<br/><ul>';
if (req.connection.userGroups) {
for (var i in req.connection.userGroups) {
out += '<li>'+ req.connection.userGroups[i] + '</li><br/>\n';
}
}
out += '</ul>';
res.send(out);
});
// Start server
var port = process.env.PORT || 3000;
server.listen(port, function () {
console.log('Express server listening on port %d in %s mode', port,
app.get('env'));
});
On Monday, November 7, 2016 at 10:38:40 PM UTC-8, Sander Elias wrote:
>
> Hi Tito,
>
> The only package I know about is node-sspi
> <https://github.com/abbr/nodesspi>You need to be on windows for that, but
> given your request that is probably the case anyway ;)
> While it is written in C, you don't have to use C to be able to use it.
>
> There are a couple of other modules available too, but those don't seem to
> be very alive.
>
> Regards
> Sander
>
--
You received this message because you are subscribed to the Google Groups
"Angular" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.