Socket
Book a DemoInstallSign in
Socket

oauth2-proxy-authentication

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oauth2-proxy-authentication

Authenticates requests from bitly/oauth2_proxy

latest
Source
npmnpm
Version
0.0.0
Version published
Maintainers
1
Created
Source

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.

Keywords

oauth2_proxy

FAQs

Package last updated on 02 Oct 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts