Last active
May 21, 2020 15:42
-
-
Save gokulraja/cd81751511927fc262132cc489b9cc89 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'), | |
ntlm = require('express-ntlm'); | |
const port = 3000; | |
var app = express(); | |
app.use(ntlm({ | |
debug: function() { | |
var args = Array.prototype.slice.apply(arguments); | |
console.log.apply(null, args); | |
}, | |
domain: 'MYDOMAIN', | |
domaincontroller: 'ldap://myad.example', | |
})); | |
app.all('*', function(request, response) { | |
response.end(JSON.stringify(request.ntlm)); // {"DomainName":"MYDOMAIN","UserName":"MYUSER","Workstation":"MYWORKSTATION"} | |
}); | |
//app.listen(port); | |
app.listen(port, () => console.log(`Example app listening at http://localhost:${port}`)) | |
//https://stackoverflow.com/questions/47677201/get-logged-windows-user-in-nodejs | |
//https://gist.github.com/gokulraja/76c3192a6d6c8bfbb132080ca874e25d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment