Nextengine authentication strategy for Passport and Node.js.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
lib
.editorconfig
.gitignore
LICENSE
README.md
index.js
package.json

README.md

passport-nextengine

Nextengine authentication strategy for Passport and Node.js.

Install

$ npm install passport-nextengine

Usage

Create nextengine application

At first, you must create new application.

  1. Login nextengine
  2. Click アプリを作る
  3. Input required information and callback uri in test environment
  4. Copy クライアントID(client id) and クライアントシークレット(client secret)

Register strategy

const NextengineStrategy = require('passport-nextengine').Strategy
passport.use(new NextengineStrategy({
  clientId: 'YOUR_CLIENT_ID',
  clientSecret: 'YOUR_CLIENT_SECRET',
  // redirectUri: 'YOUR_REDIRECT_URI'
}, (user, done) => {
  done(null, user)
}))

Authenticate

app
  // POST /auth/nextengine
  .use(route.post('/auth/nextengine',
    passport.authenticate('nextengine')
  ))
  // GET /auth/nextengine/callback
  .use(route.get('/auth/nextengine/callback',
    passport.authenticate('nextengine', {
      failureRedirect: '/',
      successRedirect: '/dashboard'
    })
  ))

For more details, please see Example application .

License

The MIT License