Socket
Socket
Sign inDemoInstall

yconnect-jp

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    yconnect-jp

A Simple Yahoo Japan Yconnect Library


Version published
Weekly downloads
3
increased by50%
Maintainers
1
Install size
10.4 kB
Created
Weekly downloads
 

Readme

Source

##yconnect-jp##

A Simple Yahoo Japan Yconnect Library

Example:

var http = require('http');
var url = require('url');
var Yconnect = require('yconnect-jp');

var options = {
  appId: 'id',
  secret: 'secret',
  redirectUri: 'http://127.0.0.1:3000/',
  state: 'ZSEDXDRFCFTTGVGYBNJUIJNJKIOKMKLPOOLLP',
  nonce: 'LPMKOKJMNIJNJIJBHUHUHYGVCFTFCFRDXDESZSEWSAWQERTYIU'
};
var yconnect = new Yconnect(options);

http.createServer(function(request, response) {
  var queryData = url.parse(request.url, true).query;
  
  if (queryData.code) {
    yconnect.getAccessToken(queryData.code, function(accessToken) {
      response.writeHead(200, {"Content-Type": "text/plain"});
      response.end(JSON.stringify(accessToken));
    });
  } else {
    var redirectUri = yconnect.getAuthorizationUri();
    response.writeHead(302, {'Location': redirectUri});
    response.end();
  }
}).listen(3000);

Then, go http://127.0.0.1:3000/ to get the access token

Keywords

FAQs

Last updated on 30 Aug 2015

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc