Skip to content

@Piot /ntlm_fake.js
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Minimal fake NTLM authentication nodejs
var http = require('http');
http.createServer(function (req, res) {
console.log("req:", req.headers);
auth = req.headers['authorization'];
if (auth && auth.substr(0, 4) === "NTLM") {
if (auth.length > 200) {
res.end("Done");
return;
}
authString = 'NTLM TlRMTVNTUAACAAAADAAMADAAAAABAoEAASNFZ4mrze8AAAAAAAAAAGIAYgA8AAAARABPAE0AQQBJAE4AAgAMAEQATwBNAEEASQBOAAEADABTAEUAUgBWAEUAUgAEABQAZABvAG0AYQBpAG4ALgBjAG8AbQADACIAcwBlAHIAdgBlAHIALgBkAG8AbQBhAGkAbgAuAGMAbwBtAAAAAAA=';
} else {
authString = 'NTLM';
}
res.writeHead(401, {'WWW-Authenticate': authString});
res.end();
}).listen(8080);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.