node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org ยป



Internal SSO verification tool for Prezi's GodAuth service


You will need a https server to use godauth.js:

Include the openssl chef cookbook on the server hosting your Node.js app.

Initialize the https server with the following options:

    key: fs.readFileSync('/etc/ssl/private/*'),
    cert: fs.readFileSync('/etc/ssl/private/*')


npm install prezi-godauth

Usage example

var godAuth = require("prezi-godauth");

// _settings.godAuthSecret is the godauth cookie secret string
var authenticator = godAuth.create(_settings.godAuthSecret);

// You can either authenticate a HTTP request
authSuccess = authenticator.authenticateRequest(request, response);

// Or authenticate by providing the credentials manually
authSuccess = authenticateCookie(authtokenCookieValue, userAgentString);

In case of successful authentication the functions will return a dictionary with the following keys:

  • email
  • roles
  • timestamp
  • signature

In case of unsuccessful authentication the return value is null. If you are using the authenticateRequest function, a redirect to the prezi login page is done automatically.