Skip to content

Instantly share code, notes, and snippets.

View dmansfield's full-sized avatar

David Mansfield dmansfield

View GitHub Profile
@dmansfield
dmansfield / http_client_spnego.js
Created August 7, 2015 13:27
Node.js HTTP client with kerberos/gssapi/negotiate/spnego authentication
//
// tested with kerberos 0.0.12 on linux against apache running mod_auth_kerb with Samba AD providing KDC
//
var Kerberos = require('kerberos').Kerberos;
var kerberos = new Kerberos();
var http = require('http');
function httpget(opts, callback) {
console.log('submitting to '+(opts.hostname||opts.host)+' with authorization header: '+(opts.headers||{}).authorization);
var req = http.get(opts, function(res) {