Created
March 19, 2011 18:31
-
-
Save vinibaggio/877689 to your computer and use it in GitHub Desktop.
Clarification for https://github.com/intridea/omniauth/issues#issue/229
This file contains 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
# 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 |
This file contains 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
#!/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