Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Failed to load latest commit information.
test
.editorconfig Make .editorconfig file
.eslintrc.yml Move to ESLint
.gitignore Integration with Coveralls
.travis.yml Build on Travis CI
CHANGELOG.md Create CHANGELOG
CONTRIBUTING.md Add contributing guide
LICENSE Add license file
README.md Tweak author style
index.js Fix handling the request URL string
package.json Bump chai version to ^2.0.0

README.md

node-yconnect

NPM version Build Status Dependency Status Coverage Status

YConnect (OAuth 2.0 + OpenID connect authorization) for Node.js.

Getting Started

Install to using NPM.

$ npm install yconnect

By passing the access token to access the API, you can retrieve the data.

Here is an example to access the UserInfo API:

var yconnect = require('yconnect');

yconnect("<YOUR_ACCESS_TOKEN>").getUserInfo({schema: 'openid'}, function (error, data) {
    if (!error) {
        console.log(JSON.parse(data));
    } else {
        console.log(error);
    }
});

The result is just below.

{ user_id: '43M63NAGMHBAYMXRMY3WODOWS4',
  name: 'OkumuraRyuichi',
  given_name: 'Ryuichi',
  'given_name#ja-Kana-JP': '',
  'given_name#ja-Hani-JP': 'Ryuichi',
  family_name: 'Okumura',
  'family_name#ja-Kana-JP': '',
  'family_name#ja-Hani-JP': 'Okumura',
  locale: 'ja-JP',
  email: 'okuryu@gmail.com',
  email_verified: true,
  address:
   { country: 'jp',
     postal_code: '1060032',
     region: 'Tokyo',
     locality: 'Minato-ku' },
  birthday: '1984',
  gender: 'male' }

More details to use YConnect

All the stuff in YConnect official documents.

Author

License

This module is available under the BSD license.

The oauth module is available under the MIT license.

Something went wrong with that request. Please try again.