passport-amebame
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

passport-amebame

Passport strategy for authenticating with Amebame using the OAuth 2.0 API.

install

$ npm install passport-amebame --save

Usage

Strategy Configuration

const Amebame = require('passport-amebame');

passport.use(new Amebame.Strategy({
  clientID: 'YOUR_CLIENT_ID', // Required
  clientSecret: 'YOUR_CLIENT_SECRET', // Required
  scope: '', // Optional
  authOrigin: '', // Optional
  profileOrigin: '', // Optional
}, function(accessToken, refreshToken, params, profile, done) {
  User.findOrCreate({ id: profile.id, profile }, function(err, user) {
    if (err) { return done(err); }
    done(null, user);
  });
}));

Authenticate Request

You can see it in the example application.

/passport-amebame/

    Package Sidebar

    Install

    npm i passport-amebame

    Weekly Downloads

    0

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    8.98 kB

    Total Files

    7

    Last publish

    Collaborators

    • ahomu
    • herablog
    • tokimari