Skip to content

Instantly share code, notes, and snippets.

@ejfinneran
Created July 11, 2014 22:33
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 ejfinneran/10503cb76ae438ac4569 to your computer and use it in GitHub Desktop.
Save ejfinneran/10503cb76ae438ac4569 to your computer and use it in GitHub Desktop.
Authenticating Resque Web via GitHub OAuth
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
require 'resque/server'
require 'resque-cleaner'
require 'sinatra_auth_github'
require './app'
map "/" do
run Cloudability::Resque
end
@ejfinneran
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment