I\'m trying to write a simple script that requests some data from a tool on an internal network. Here is the code:
#!/usr/bin/node
var https = require(\'htt
2020 UPD:
The newer version of kerberos npm package has much less methods. But I make it work:
const kerberos = require('kerberos').Kerberos;
const fetch = require('node-fetch');
(async () => {
const client = await kerberos.initializeClient("HTTP@site.internal.net", {
mechOID: kerberos.GSS_MECH_OID_SPNEGO,
})
const ticket = await client.step("")
const resp = await fetch("https://site.internal.net/api/v1/hello", {
headers: {
'Authorization': 'Negotiate ' + ticket
}
})
console.log(await resp.json())
})();
Works perfectly at Windows and Linux, should work at macOS too.