This puts together a number of packages to create a template for using GitHub authentication with Node, enabling developers to quickly tweak and deploy services.
Features:
expressfor the websiteexpress-sessionfor the local session cachesimple-oauth2for the OAuth danceoctocatfor working against the GitHub API
You need to create a third-party application on GitHub to use this correctly. After creating the application, you will need to define these environment variables before the website will run successfully:
GITHUB_CLIENT_IDGITHUB_CLIENT_SECRETGITHUB_PERSONAL_ACCESS_TOKENOAUTH_CALLBACK_URL- this is the fully-qualified URL to your server
You should look at the values defined for scope as this will determine
what permissions your application has after the user authenticates the app.
The express-session setup uses an in-memory store, so it's not
production-ready. I recommend looking at this documentation
if you want to integrate this into an existing environment.