Protect your Sidekiq Web dashboard with Google Sign-In. We developed this for MagicBell.io
-
Create a project. Give it a name like "My Application Sidekiq Web".
-
Click on the "Library" section in the sidebar. Search for "Contacts API". Enable it. Now, search for "Google+ API" and enable that as well.
-
Click on the "Credentials" section in the sidebar and then click on the "OAuth consent screen" at the top. Fill the OAuth consent screen form and click Save.
-
Click on the "Create credentials" button and choose "OAuth client ID" in the menu that pops up. Select "Web application" as the Application Type. Enter a name like "My Application Sidekiq Web". Enter a URL like https://myapplication.com/sidekiq/auth/google_oauth2/callback in the "Authorized redirect URIs" field and click Create.
-
Copy the displayed client id and secret
-
Add the
sidekiq_web_google_sign_in
gem to your Gemfilegem "sidekiq_web_google_sign_in", :git => "https://github.com/magicbell-io/sidekiq_web_google_sign_in", :tag => "v1.0.0.beta1"
and run
bundle install
-
Create the file
config/initializers/sidekiq_web_google_sign_in.rb
and configure the gemif Rails.env.production? SidekiqWebGoogleSignIn.use :google_sign_in_client_id => "my_google_sign_in_client_id", :google_sign_in_client_secret => "my_google_sign_in_client_secret", :session_domain => "myapplication.com", :employee_emails => Proc.new { |email| email.end_with?("@myapplication.com") } end
- Publish the gem in https://rubygems.org/
- Support Sinatra applications