A simple way to use GitHub OAuth to serve a protected Jekyll site to your GitHub organization
But what if you only want to share that site with a select number of people? Before, you were SOL. Now, simply host the site on a free, Heroku Dyno, and whenever someone tries to access it, it will Oauth them against GitHub, and make sure they're a member of your Organization. Pretty cool, huh?
- A GitHub account (one per user)
- A GitHub Organization (of which members will have access to the Jekyll site)
- A GitHub Application (you can register one for free)
- A Heroku account (you can technically use this elsewhere, but the instructions are for Heroku)
Under the hood
Every time you push to Heroku, we take advantage of the fact that Heroku automatically runs the
rake assets:precompile command (normally used for Rails sites) to build our Jekyll site and store it statically, just like GitHub pages would.
If they're in the org, they get the page. Otherwise, all they ever get is the bouncer.