Answer the question
In order to leave comments, you need to log in
Is it possible to get the client's username by ip or hostname?
Hello comrades! Please help me figure it out.
In a Node.js application, I get a unique ip address of a client that makes a request to a specific URL. Further on this ip address I get a unique hostname of this client. Is it possible in theory to somehow get the client's username ? Perhaps somehow from the Active Directory it is possible to pull out this information?
router.get('/', function(request, response) {
// Client IP.
let ip = request.headers['x-forwarded-for'] || request.connection.remoteAddress;
ip = ip.replace('::ffff:', '');
console.log(ip);
dns.lookupService(ip, 22).then((result) => {
const hostname = result.hostname;
console.log(hostname);
});
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question