Setup Google OAuth for login, do not create new accounts, add button to front page#412
Open
cycomachead wants to merge 1 commit intomainfrom
Open
Setup Google OAuth for login, do not create new accounts, add button to front page#412cycomachead wants to merge 1 commit intomainfrom
cycomachead wants to merge 1 commit intomainfrom
Conversation
- Add `omniauth-google-oauth2` and configure provider conditionally - Implement `handle_google_login` to authenticate only existing users by email - Prevent new account creation or LMS credential updates via Google OAuth - Add "Login with Google" button to home page, gated by environment variables - Add comprehensive specs for helper visibility and authentication logic Co-authored-by: Claude Code <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
General Info
Changes
Adds Google OAuth as a login option for users who already have an account. Google login will never create new accounts — it only authenticates users whose email matches an existing record. This allows instructors/admins with Google accounts to log in without going through Canvas, while keeping account provisioning strictly tied to the Canvas OAuth flow.
Key changes:
omniauth-google-oauth2gem and configured the provider conditionally (only whenGOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRETenv vars are both present)google_oauth_enabled?helper inApplicationHelperto gate UI and provider registration on env var presencehandle_google_logininSessionControllerthat looks up the user by email and sets the session — no user creation, no LMS credential writesGOOGLE_CLIENT_ID/GOOGLE_CLIENT_SECRETin.env.exampleTesting
Added specs covering:
google_oauth_enabled?helper (all 4 env var combinations)All 161 controller specs and 23 new/touched specs pass.
Documentation
No additional documentation required. New environment variables are documented in
.env.example.Checklist
Superconductor Ticket Implementation | App Preview | Guided Review