oauth2-proxy-authentication

0.0.0 • Public • Published

oauth2-proxy-authentication

NOTE: This npm will not work until after bitly/oauth2_proxy#147 is integrated.

Authenticates requests from bitly/oauth2_proxy based on a shared-secret HMAC signature of the request.

Installation

$ npm install oauth2-proxy-authentication --save

Usage

Assuming you're using Express, during initialization of your application, where config.secretKey is the shared secret between your application and the running instance of bitly/oauth2_proxy:

var express = require('express');
var bodyParser = require('bodyParser');
var oauth2ProxyAuthentication = require('oauth2-proxy-authentication');
 
function doLaunch(config) {
  var middlewareOptions = {
    verify: oauth2ProxyAuthentication.middlewareValidator(config.secretKey)
  };
  var server = express();
  server.use(bodyParser.raw(middlewareOptions));
 
  // Continue server initialization...
}

If you're not using Express, you can use the function validateRequest(req, rawBody, secretKey) directly, where rawBody has already been converted to a string.

Public domain

This project is in the worldwide public domain. As stated in CONTRIBUTING:

This project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication.

All contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.

Package Sidebar

Install

npm i oauth2-proxy-authentication

Weekly Downloads

1

Version

0.0.0

License

CC0-1.0

Last publish

Collaborators

  • ginayam
  • sb-nava
  • cvfergus
  • mneveunava
  • nava-matt
  • tts-tech-portfolio
  • 18f-devops
  • mgwalker
  • stvnrlly
  • rori123
  • aduth
  • aidanfeldman
  • mbland