Switch 'log in with snap' feature from Discourse SSO to Snap!Cloud provider#411
Open
cycomachead wants to merge 1 commit intomainfrom
Open
Switch 'log in with snap' feature from Discourse SSO to Snap!Cloud provider#411cycomachead wants to merge 1 commit intomainfrom
cycomachead wants to merge 1 commit intomainfrom
Conversation
Replaces the Discourse forum SSO provider with Snap!Cloud's SSO endpoint. Since Snap!Cloud implements the same Discourse SSO protocol, this change updates the configuration URLs and environment variables while maintaining backward compatibility for the SSO secret. - Update SSO URL to point to snap.berkeley.edu API - Introduce OSEM_SNAP_SSO_SECRET and OSEM_SNAP_SSO_URL env vars - Fix provider detection logic to only require a secret for Discourse - Remove outdated "log in twice" UI warning - Add Discourse mock authentication for development and testing 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.
Pivotal Tracker Link
What this PR does:
This pull request implements switching the "Log in with Snap" feature from using the Snap Forum (Discourse) as the SSO provider to using Snap!Cloud directly.
Since Snap!Cloud already implements the Discourse SSO provider protocol at
/api/v1/discourse-sso, no gem changes are needed — the existingomniauth-discoursegem works as-is, just pointed at a new URL.Key Changes
config/initializers/devise.rb— Updates the SSO URL tohttps://snap.berkeley.edu/api/v1/discourse-sso(configurable viaOSEM_SNAP_SSO_URL). Secret now reads fromOSEM_SNAP_SSO_SECRETwith fallback toOSEM_DISCOURSE_SECRETfor backward compatibility.app/helpers/users_helper.rb— Fixes provider detection for Discourse SSO, which only requires a secret (not a key+secret pair like OAuth providers). Now correctly checks forOSEM_SNAP_SSO_SECRETor the fallback.How should this PR be tested?
OSEM_SNAP_SSO_SECRETto match theDISCOURSE_SSO_SECRETset in the Snap!Cloud instance and verify the login flow completes successfully end-to-end.OSEM_SNAP_SSO_SECRETis set and does not appear when it is unset.spec/support/omniauth_macros.rb.Are there any complications to deploying this?
OSEM_SNAP_SSO_SECRETmust match theDISCOURSE_SSO_SECRETconfigured on the Snap!Cloud side. Existing deployments usingOSEM_DISCOURSE_SECRETwill continue to work without changes due to the fallback — no immediate action required on deploy.Checklist:
Superconductor Ticket Implementation | Guided Review