Opinionated wrapper around Passport.js. It supports logins via Facebook and local users.
npm install --save @akoenig/sso
The following describes the configuration for performing a Facebook SSO
const app = ;const restricted =;
This results in a new handler which can be accessed via
GET /auth/facebook. The user gets redirected to Facebook and has to perform the authentication process there. Afterwards the user will be send back to
callbackUrl by Facebook.
The following describes the configuration for performing a local SSO (own users in a database):
const restricted =;
This registers the following route handler:
POST /auth/local. You can perform a request against that route with the help of a form:
Each time the user submits that form, the provided
verify function gets executed. You have to verify the user within that function by gathering the user from your database. The parameters
password are filled with the values from the form.