Example of netlify authentication with Passportjs
This project shows how to use the very popular PassportJS library (normally available under expressjs) with the Netlify platform running under AWS Lambda.
We took the example of Google OAuth, but you can use any PassportJS strategy (Twitter, Facebook, Local, JWT, Github, ...).
You can clone on you local with:
git@github.com:svengau/netlify-authentification-sample.git
Alternatively you can deploy straight to Netlify with this one-click Deploy:
Once deployed, don't forget to configure the 3 following env variables:
- GOOGLE_AUTH_CLIENT_ID: your google client id
- GOOGLE_AUTH_CLIENT_SECRET: your google client secret key
- SESSION_SECRET: a random session secret
Live Demo
You may test out a deployed version of this project here: https://netlify-authentification-sample.netlify.com/