Skip to content

Instantly share code, notes, and snippets.

View RReivax's full-sized avatar

Xavier Hermand RReivax

View GitHub Profile

How to authenticate with Kerberos to a Thrift API in Node.js ?

You can force Thrift to use the HTTP transport method. Therefore, it will understand the SPNEGO mechanism. You just need to add the SPNEGO token to the Authorization HTTP header.

Here is a full example using the Node.js krb5 module. We are requesting tables of a Kerberized HBase Thrift API.

var thrift = require("thrift");
var htypes = require("./gen-nodejs/hbase1_types");
var hbase = require("./gen-nodejs/Hbase");
# -*- mode: ruby -*-
# vi: set ft=ruby :
box = "centos/7"
if Vagrant::VERSION == '1.8.5'
ui = Vagrant::UI::Colored.new
ui.error 'Unsupported Vagrant Version: 1.8.5'
ui.error 'Version 1.8.5 introduced an SSH key permissions bug, please upgrade to version 1.8.6+'
ui.error ''

Keybase proof

I hereby claim:

  • I am rreivax on github.
  • I am rreivax (https://keybase.io/rreivax) on keybase.
  • I have a public key ASCOACI8n4-CIhelJf3bBldo8-GrNXJxFY_BYdGCv2xTRwo

To claim this, I am signing this object: