Socket
Socket
Sign inDemoInstall

axios-oauth-1.0a

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

axios-oauth-1.0a

Easily add OAuth 1.0a signing to your axios client


Version published
Weekly downloads
16K
increased by19.38%
Maintainers
1
Weekly downloads
 
Created
Source

axios-oauth-1.0a

Easily add OAuth 1.0a signing to your axios client

Getting Started

npm i axios-oauth-1.0a

or

yarn add axios-oauth-1.0a

For use in the browser, you'll need to configure buffer and crypto support polyfills and fallback modules. See resolve.fallback and How To Polyfill Buffer With WebPack v5 for more information.

OAuth Options

algorithm

  • The hashing function to use for the oauth_signature value
  • Available values are: HMAC-SHA1, HMAC-SHA256
  • Default value is HMAC-SHA256

includeBodyHash

  • When true, always try to hash the body and include the hash in the signature
  • When false, never try to calculate oauth_body_hash
  • When 'auto', calculate oauth_body_hash on PUT or POST requests that have a body

key

  • The Consumer Key value

realm

  • An optional value to set the OAuth 1.0 realm

secret

  • The Consumer Secret value

token

  • The Access Token value

tokenSecret

  • An optional value to specify the access token secret

callback

  • An optional value to set the callback url

verifier

  • An optional value to set the oauth verifier

Example

To sign your axios requests using OAuth 1.0a:

import addOAuthInterceptor from 'axios-oauth-1.0a';

// Create a client whose requests will be signed
const client = axios.create();

// Specify the OAuth options
const options = {
    algorithm: 'HMAC-SHA1',
    key: 'xxx',
    secret: 'yyy',
};

// Add interceptor that signs requests
addOAuthInterceptor(client, options);

Documentation

ChangeLog

See github releases

Keywords

FAQs

Package last updated on 11 Aug 2022

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc