Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 1.62 KB

README.md

File metadata and controls

29 lines (22 loc) · 1.62 KB

:Blazer with Google OAuth2 sign in

Blazer with Google OAuth2 sign in based on ankane/blazer-docker.

Setup

  1. Create a new OAuth 2.0 Client ID:
    • Application type: Web application
    • Authorized JavaScript origins: http://localhost and http://localhost:8080
    • Authorized redirect URIs: http://localhost:8080/users/auth/google_oauth2/callback
  2. Create a .env based on the .env.example and add your Google OAuth2 credentials.
  3. Edit the docker-compose.yml and change the DATABASE_URL and BLAZER_DATABASE_URL (suggestions are in file)
  4. Run docker-compose up and access at http://localhost:8080.
  5. Connect to the web service and run rails db:migrate.

All routes are protected by Devise, so will need to sign in with Google to access Blazer. Users that are already signed into their Google account will be automatically signed in once they've accepted the consent screen.

Notes

To remove Google Sign-in and use server-side sign-in:

  1. Add gem "omniauth-rails_csrf_protection" to the Gemfile.
  2. Delete the config/initializers/omniauth.rb file.
  3. Add a sign-in button to app/views/devise/sessions/new.html.erb:
<%= button_to "Sign in with Google", user_google_oauth2_omniauth_authorize_path, method: :post %>

Credits