Skip to content

Route ASWebAuthenticationSession URLs#524

Draft
bric3 wants to merge 3 commits into
johnste:mainfrom
bric3:fix/sso-web-auth-session
Draft

Route ASWebAuthenticationSession URLs#524
bric3 wants to merge 3 commits into
johnste:mainfrom
bric3:fix/sso-web-auth-session

Conversation

@bric3
Copy link
Copy Markdown
Contributor

@bric3 bric3 commented May 15, 2026

⚠️ Still in progress as some flow don't work yet.

@johnste You maybe the one that may finish this, I cannot make this work locally, maybe this related to this constraint : https://bugzilla.mozilla.org/show_bug.cgi?id=1921535#c10

testing with a third-party app requires Firefox to be “signed using production entitlements” and to have only one install with that bundle ID.

Since I'm signing this adhoc because i don;t have a developer account, this doesn't appear to work properly.

By the way I created this app (the archive contains sources only, so you'll have to build it), unsure if this is that useful: finicky-auth-session-test-source.tar.gz


Apps like Slack and Claude Desktop use ASWebAuthenticationSession for SSO/OAuth sign-in flows. Those requests do not go through the normal http/https default-browser Launch Services path; macOS only forwards them to the default browser if it declares web authentication session support in Info.plist. Without that declaration, the system falls back to Safari before Finicky can apply any routing rules.

https://developer.apple.com/documentation/authenticationservices/supporting-single-sign-on-in-a-web-browser-app#Declare-the-Session-Handling-Capability

This declares Finicky as an ASWebAuthenticationSession-capable browser and register a session handler that forwards incoming authentication URLs through the existing URL handling pipeline.

However, it does not declare ephemeral browser session support (EphemeralBrowserSessionIsSupported). Indeed, Finicky routes URLs to another browser rather than owning the browsing context itself, so it cannot reliably guarantee that cookies, storage, or profile state are isolated for requests where AuthenticationServices asks for an ephemeral session.

At this time, advertising only the base capability should be the minimal and honest thing to do, and this choice can be re-evaluated if this becomes an issue.

Should fix #405


Note, I'm not sure how to unit test that. The integration point main.m is not, and this part rely on macOs Launch Services.

Apps like Slack and Claude Desktop use `ASWebAuthenticationSession` for
SSO/OAuth sign-in flows. Those requests do not go through the normal
http/https default-browser `Launch Services` path; macOS only forwards
them to the default browser if it declares web authentication session
support in `Info.plist`. Without that declaration, the system falls back
to Safari before Finicky can apply any routing rules.

https://developer.apple.com/documentation/authenticationservices/supporting-single-sign-on-in-a-web-browser-app#Declare-the-Session-Handling-Capability

This declares Finicky as an `ASWebAuthenticationSession`-capable browser
and register a session handler that forwards incoming authentication URLs
through the existing URL handling pipeline.

However, it does not declare ephemeral browser session support
(`EphemeralBrowserSessionIsSupported`). Finicky routes URLs
to another browser rather than owning the browsing context itself, so it
cannot reliably guarantee that cookies, storage, or profile state are
isolated for requests where `AuthenticationServices` asks for an ephemeral
session.

At this time, advertising only the base capability should be
the minimal and honest thing to do, if this becomes an issue this choice
can be re-evaluated.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3345013e-eea5-4481-a9b0-deffce62b86e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

bric3 added 2 commits May 15, 2026 15:05
Install the ASWebAuthenticationSession handler before Finicky finishes its normal config bootstrap, so launches initiated by AuthenticationServices have a handler available immediately.

Forward authentication requests through the normal URL resolver with a synthetic AuthenticationServices opener, while preserving best-effort callback completion for callback URLs that come back through Finicky.

Keep the http/https URL type separate from the finicky scheme so Launch Services sees the browser URL claim cleanly.
Some ASWebAuthenticationSession clients require the selected browser to advertise callback URL matching before they will route SSO requests through it. Finicky can complete callbacks that re-enter Finicky, which preserves custom-scheme flows and gives callback-aware clients a route through the existing browser rules.

This is intentionally best-effort: once Finicky forwards the initial auth URL to the concrete browser selected by user rules, it cannot observe subsequent navigations in that browser. Document that limitation next to the callback completion code.

Do not declare ephemeral session support yet, because Finicky does not currently force an incognito or private session in the selected browser and should not claim stronger privacy semantics than it can provide.
jamtur01 added a commit to jamtur01/grinch that referenced this pull request May 15, 2026
The capability dict claimed support for ephemeral browser sessions
(`shouldUseEphemeralSession`-flagged requests), but Grinch forwards
auth URLs to the user's regular browser — which carries their
existing cookies and profile state. Apple's contract for ephemeral
sessions is "no cookies, no storage, no profile shared with normal
browsing", and we can't honour that as a router.

johnste/finicky#524 makes the same call with the same rationale.
Apps that strictly require an ephemeral session now see the missing
key and can fall back to a non-ephemeral flow rather than trusting
an isolation guarantee that isn't actually delivered. Apps that
don't request ephemeral (the vast majority) are unaffected.

Inline comment in Info.plist documents the omission.

Cargo.toml: add `NSUUID` and `NSUserActivity` features to
objc2-foundation in preparation for the next two PR-#524-aligned
changes (callback completion tracks request UUIDs; Universal-Links
auth callbacks arrive via continueUserActivity:).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Finicky v3 and v4 cannot open to sign-in by open as a popup window

1 participant