passport-jirengu
Install
$ npm install passport-jirengu
Usage
Create an Application
Before using passport-jirengu
, you must register an application with Jirengu.
If you have not already done so, a new application can be created at
developer applications within
Jirengu's settings panel. Your application will be issued a client ID and client
secret, which need to be provided to the strategy. You will also need to
configure a callback URL which matches the route in your application.
Configure Strategy
The Jirengu authentication strategy authenticates users using a Jirengu account
and OAuth 2.0 tokens. The client ID and secret obtained when creating an
application are supplied as options when creating the strategy. The strategy
also requires a verify
callback, which receives the access token and optional
refresh token, as well as profile
which contains the authenticated user's
Jirengu profile. The verify
callback must call cb
providing a user to
complete authentication.
var JirenguStrategy = Strategy; passport;
Authenticate Requests
Use passport.authenticate()
, specifying the 'jirengu'
strategy, to
authenticate requests.
For example, as route middleware in an Express application:
app; app;
Examples
You can find example at http://note.ruoyu.site
License
Copyright (c) 2011-2016 Jared Hanson <http://jaredhanson.net/>