Socket
Socket
Sign inDemoInstall

oauth-sign

Package Overview
Dependencies
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oauth-sign

OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module.


Version published
Weekly downloads
13M
increased by2.98%
Maintainers
3
Weekly downloads
 
Created

What is oauth-sign?

The oauth-sign npm package provides utilities for signing OAuth 1.0 and 2.0 requests. It supports HMAC-SHA1, RSA-SHA1, and PLAINTEXT signing methods, making it easier to generate OAuth signatures for HTTP requests.

What are oauth-sign's main functionalities?

HMAC-SHA1 Signing

This feature allows you to generate an HMAC-SHA1 signature for an OAuth request. The code sample demonstrates how to use the `hmacsign` method to create a signature using the consumer secret, token secret, and base string.

const oauth = require('oauth-sign');
const consumerSecret = 'consumerSecret';
const tokenSecret = 'tokenSecret';
const baseString = 'baseString';
const signature = oauth.hmacsign('GET', baseString, consumerSecret, tokenSecret);
console.log(signature);

RSA-SHA1 Signing

This feature allows you to generate an RSA-SHA1 signature for an OAuth request. The code sample demonstrates how to use the `rsasign` method to create a signature using the private key and base string.

const oauth = require('oauth-sign');
const privateKey = 'privateKey';
const baseString = 'baseString';
const signature = oauth.rsasign('GET', baseString, privateKey);
console.log(signature);

PLAINTEXT Signing

This feature allows you to generate a PLAINTEXT signature for an OAuth request. The code sample demonstrates how to use the `plaintext` method to create a signature using the consumer secret and token secret.

const oauth = require('oauth-sign');
const consumerSecret = 'consumerSecret';
const tokenSecret = 'tokenSecret';
const signature = oauth.plaintext(consumerSecret, tokenSecret);
console.log(signature);

Other packages similar to oauth-sign

FAQs

Package last updated on 02 Aug 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc