Created
December 4, 2010 05:57
-
-
Save rmanalan/727958 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'bundler/setup' | |
require 'sinatra' | |
require 'omniauth' | |
require 'openid/store/filesystem' | |
use Rack::Session::Cookie | |
use OmniAuth::Builder do | |
provider :open_id, OpenID::Store::Filesystem.new('/tmp') | |
provider :twitter, 'xxx', 'xxx' | |
end | |
enable :static | |
get '/' do | |
if @auth | |
"Welcome #{@auth.inspect} " | |
else | |
"Logged out. <a href='/auth/twitter'>login</a>" | |
end | |
end | |
get '/auth/:provider/callback' do | |
@auth = request.env['omniauth.auth'] | |
@auth.inspect | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment