This is a small example of using an openID provider to add authentication to your applications. I had a ton of trouble understanding the Passport workflow so hopefully this helps.
Try it out here!
It's using Passport, and it's implemented on the frontend using Vue.js, but any framework would work - accessing a single api point is all that needs to be done to check user logged-in status and retrieve data.
- Start with the obvious:
npm install
- Rename
server/settings.js.example
toserver/settings.js
and fill in all of your information for Mongo, Twitch, etc.
For this project, you'll be running two servers: a Node server for the backend, and vue-cli-service for hot-reloading and building your app. Run each of the following commands in two different terminals:
node server.js
npm run serve
The example app is now up and running. You should be able to login with your Twitch account.
You'll need to change the Passport strategy. Just about every service already has a passport strategy available. You'll need to update server.js
but that's about it.
I'd love to help - UPDATE: I don't have social media anymore, so just leave an issue here on Github.