Created
May 14, 2020 18:58
-
-
Save gokulraja/70120980e3aa9132db4a7e9379e110e8 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment