cli-oauth-client

1.0.0 • Public • Published

cli-oauth-client

npm version

Library and CLI tool that requests OAuth 1.0 tokens without need for a remote server. Designed for CLI tools that require three-pegged OAuth authentication.

When invoked, it will:

  • Request an OAuth token on behalf of your application
  • Spin up a temporary local server to handle the OAuth callback from the identity provider
  • Open a browser window with the identity provider authorization url
  • Request and return access token/secret, along with the OAuth client

Can be used as a CLI tool or library.

Installation

As a CLI:

npm install -g cli-oauth-client

As a library:

npm install cli-oauth-client oauth

Usage

For the CLI, run cli-oauth-client for usage details.

For the library, there is one function:

const cliOAuthClient = require('cli-oauth-client')

const result = await cliOAuthClient.getToken(requestTokenUrl, authorizeUrl,
  accessTokenUrl, consumerKey, consumerSecret)

Three fields in result object:

Readme

Keywords

none

Package Sidebar

Install

npm i cli-oauth-client

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

6.04 kB

Total Files

6

Last publish

Collaborators

  • djandries