If you want to authenticate your user in your app with Github use omniauth-github strategy for that. Here I am describing how you can do that very quickly. OmniAuth provides list of strategies to use many OAuth for your application. Here is the List of Strategies.
Github uses the OAuth2 flow. First of all you have to register your app with Github GitHub Applications Page. Create a new application here and get Client ID and Secret. Here is how can you obtain Client ID and Secret from Github.
Steps to use these in your app.
rails new GithubAuthApp
use OmniAuth::Builder do
provider :github, XXXX, YYYY
All done start you server
Just open your app in browser with URL
You will be redirecting to Github for authentication.
After success your app will redirect to your given callback URL with information and token!
At OmniAuth.org you can try out different -2 Strategies.
Useful links :