@mi-sec/passport-geoaxis-oauth
v1.1.0
Published
GEOAxIS (OAuth 2.0) authentication strategy for Passport.
Downloads
7
Readme
passport-geoaxis-oauth
GEOAxIS (OAuth 2.0) authentication strategy for Passport.
Installation
npm i @mi-sec/passport-geoaxis-oauth
Usage
Basic usage:
const
config = require( 'config' ),
passport = require( 'passport' ),
{
Strategy: GEOAxISStrategy
} = require( 'passport-geoaxis-oauth' );
const app = express();
passport.use( new GEOAxISStrategy(
{
clientID: '',
clientSecret: '',
authorizationURL: '',
tokenURL: '',
userProfileURL: '',
scope: '',
callbackURL: ''
},
function( token, refresh, profile, done ) {
return done( null, { token, refresh, profile } );
}
) );
passport.serializeUser( ( user, done ) => done( null, user ) );
passport.deserializeUser( ( obj, done ) => done( null, obj ) );
app.use( passport.initialize() );
app.use( passport.session() );