So you want to authenticate users using the Github API on your next Ruby and Rails project? Using Omniauth this is very easy to accomplish, however I set out to make it even easier by building a Rails skeleton for just this task!
First thing you want to do is create a new application on Github!
Set your Main and Callback URL accordingly! If you’re only doing local development for now, then you should be all set using both example URLs.
Now that your Github application is created, we need set some environment variables for the Client ID and Client Secret. You can do this on the command line or place both these values in your ~/.bashrc file.
Now we need to clone the project from Github and get it up and running!
1 2 3 4 5
Now just visit http://127.0.0.1:3000 in your browser and sign in! Happy hacking.