Skip to content

CA-6409: Add workaround for Google SSO#264

Closed
Phoenix7351 wants to merge 1 commit into
mainfrom
tiffner/CA-6409
Closed

CA-6409: Add workaround for Google SSO#264
Phoenix7351 wants to merge 1 commit into
mainfrom
tiffner/CA-6409

Conversation

@Phoenix7351

@Phoenix7351 Phoenix7351 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Google SSO whitelists "secure browsers." We haven't got on this list yet, but still want users to be able to use Google SSO. This workaround temporarily switches the user agent to Safari if Topaz detects a user is attempting to sign in via Google SSO.


Note

Medium Risk
Touches authentication-related navigation and broad Google host/path heuristics; misclassification could send the wrong UA on unrelated Google pages or miss edge SSO URLs.

Overview
Adds a temporary Google SSO workaround by choosing the WKWebView user agent per URL instead of always sending the Topaz string.

WebPageModel now keeps a default Topaz UA and a Safari-style UA, with customUserAgent(for:) returning the Safari string when usesGoogleCompatibleUserAgent matches juul.com Google OAuth entry, Google/YouTube account hosts, or common Google OAuth/sign-in URL patterns. Coordinator sets webView.customUserAgent from that helper on page updates and at the start of each navigation so redirects through Google still get the compatible agent.

Reviewed by Cursor Bugbot for commit a7fcc3f. Configure here.

@Phoenix7351 Phoenix7351 added the patch Changes that should bump the PATCH version number label Jun 9, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit a7fcc3f. Configure here.

public func didInitiateNavigation(_ navigation: NavigationItem, in webView: WKWebView) {
if let viewModel {
webView.customUserAgent = viewModel.customUserAgent(for: navigation.request.url)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

User agent set too late

Medium Severity

webView.customUserAgent is updated inside didInitiateNavigation, which runs from didStartProvisionalNavigation after the navigation request has already been sent. The main document load for that navigation therefore still uses the prior user agent, so direct loads of Google SSO URLs (and back/forward to them) may keep sending the Topaz agent on the request Google evaluates.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a7fcc3f. Configure here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it against Google SSO. Seems to work just fine.

@Phoenix7351

Copy link
Copy Markdown
Contributor Author

Closing in favor of #266

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

Labels

patch Changes that should bump the PATCH version number

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant