hapi-passport
hapi-passport
is supposed to be a connector between passport.js strategies and the hapi request api. Right now its in a early phase so its only tested with facebook.
usage
You need to install hapi-passport
together with the connector strategies like passport-facebook
.
$ npm install hapi-passport passport-facebook
With this you can make a request handler like this:
var FacebookStrategy = facebookLogin = ...;
and connect it hapi using
server;
By default it would just show loose error or success messages. You can work around that by passing redirect urls for the different cases:
server;
... or you can use handlers for the various cases:
server;
Resulting into something like:
var FacebookStrategy = facebookLogin = clientID: "FACEBOOK_APP_ID" // Facebook app id clientSecret: "FACEBOOK_APP_SECRET" // Facebook secret callbackURL: "http://localhost:3000/login/facebook" // needs to be added in the facebook admin interface { ; }; server;