Skip to content

Instantly share code, notes, and snippets.

@vinibaggio
Created March 19, 2011 18:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vinibaggio/877689 to your computer and use it in GitHub Desktop.
Save vinibaggio/877689 to your computer and use it in GitHub Desktop.
# coding: utf-8
FB_APP_ID = 'insert_me'
FB_APP_SECRET = 'insert_me'
class AuthApp < Sinatra::Base
use Rack::Session::Cookie
use OmniAuth::Builder do
provider :facebook, FB_APP_ID, FB_APP_SECRET
end
get '/hello' do
"Hello !!"
end
get '/:name/callback' do
auth = request.env['omniauth.auth']
auth.inspect
end
get '/failure' do
"invalid"
end
end
#!/usr/bin/env ruby
# encoding: UTF-8
$LOAD_PATH.unshift File.dirname(__FILE__)
ENV['RACK_ENV'] ||= "development"
require 'bundler'
Bundler.setup
Bundler.require(:default, ENV['RACK_ENV'].to_sym)
require 'auth_app'
map "/blog" do
run AuthApp.new
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment