Created
July 11, 2014 22:33
-
-
Save ejfinneran/10503cb76ae438ac4569 to your computer and use it in GitHub Desktop.
Authenticating Resque Web via GitHub OAuth
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
module Cloudability | |
class Resque < Resque::Server | |
enable :sessions | |
set :github_options, { | |
:scopes => "user", | |
:secret => ENV['GITHUB_CLIENT_SECRET'], | |
:client_id => ENV['GITHUB_CLIENT_ID'], | |
} | |
register Sinatra::Auth::Github | |
before do | |
github_team_authenticate!(1) | |
end | |
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
require 'resque/server' | |
require 'resque-cleaner' | |
require 'sinatra_auth_github' | |
require './app' | |
map "/" do | |
run Cloudability::Resque | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Quick example of how to authentication ResqueWeb via GitHub OAuth.
Just takes creating a new Sinatra app that inherits from Resque::Server and add a before filter.