If you add the following line of code at the beginning of your authentications/sessions/callbacks controller action:
render :text => "<pre>" + env["omniauth.auth"].to_yaml and return
You'll be able to inspect the contents of the hash returned by GitHub and see where the token
is located inside the hash.
As it happens, you can get it with token = env["omniauth.auth"].credentials.token
.
You can now create a new github_api client instance with the token:
Github.new(oauth_token: token)