Giter Site home page Giter Site logo

node-oauth-toolkit's Introduction

oauth-toolkit

RFC-5849 compliant oauth toolkit.

Yeah, yet another OAuth toolkit for node.js.

Most of npm modules are not 100% compliant to RFC-5849. These modules are failing on example of the spec. Especially when there are multiple parameters with same key like a=1&a=2, these modules overwrites former parameters with later parameters, and it results to wrong base string. And there is also a case that sort algorithm in parameter normalization deviates from the spec.

This module provides low level API for calculating oauth signature to present and validate the steps described in the specification. It may not fit your purpose if you are looking for a convinient oauth library.

Install

npm install oauth-toolkit

Usage

var oauth = require('oauth-toolkit');

var signature = oauth.signature(
    'POST', // requestMethod
    'http://example.com/request?b5=%3D%253D&a3=a&c%40=&a2=r%20b', // url
    'c2&a3=2+q', // body
    {
        consumerKey: '9djdj82h48djs9d2',
        consumerSecret: 'j49sk3j29djd',
        token: 'kkk9d7dh3k39sjv7',
        tokenSecret: 'dh893hdasih9',
        nonce: '7d8f3e4a',
        signatureMethod: 'HMAC-SHA1',
        timestamp: '137131201',
    }
);

require('assert').equal(signature, 'r6/TJjbCOr97/+UU0NsvSne7s5g=');

node-oauth-toolkit's People

Contributors

hyjin avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

qix-

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.