Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-oauth

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-oauth

A node.js client for OAuth API

  • 0.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

#:: node-oauth ::

##Abstract

An adaptor for OAuth 1.0 and OAuth 2.0 API.

##Install##

To install the most recent release from npm, run:

npm install node-oauth

##Usage##

require node-oauth

var OAuth = require('node-oauth');

set your application OAuth setting file.

OAuth = OAuth("../sample/object-oauth.js")

jump to Login page.
"response" is necessary for redirect.

OAuth.authorize('facebook',{
    response: res,
    endCallback: function(err) {
      if(err)
        onError(err);
    }
  });

(OAuth 1.0)
if you don't want to go authorize page everytime, you can control after getting request token.
Authorizer object returns. It have setting datas on its fields.

var oauthAuthorizer = OAuth.authorize('twitter', {
    auto: false
  });

get access token in redirect page
Tokener object returns.

var oauthTokener = OAuth.access(oauth['type'], {
  href: location.href
}, authorized);

if you want to set access_token externaly, ( that is , not via url )

oauthTokener.set({
  request_token: oauth['req_tkn'],
  access_token: oauth['oac_tkn'],
  access_token_secret: oauth['oac_tkn_scr']
});

access to api with name (set in setting file) / url.
data returns after JSON.parse(api-response).

oauthTokener.get("credentials", {}, function(err, data){
  if(err)
    return ...
  ...
  });

##Change Log##

  • 2013/4/16
    • 0.1.2 release
    • repository owner is changed to ystskm

Keywords

FAQs

Package last updated on 09 Apr 2021

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