Skip to content

Instantly share code, notes, and snippets.

@jeffkreeftmeijer
Created December 6, 2010 08:49
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jeffkreeftmeijer/730034 to your computer and use it in GitHub Desktop.
Save jeffkreeftmeijer/730034 to your computer and use it in GitHub Desktop.
<3
require 'sinatra'
require 'omniauth'
class Application < Sinatra::Base
use OmniAuth::Builder do
provider :github, 'github_id', 'github_secret'
end
get '/' do
'<a href="/auth/github">Sign in via Github</a>'
end
get '/auth/:name/callback' do
"Welcome, #{request.env['omniauth.auth']['user_info']['nickname']}!"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment