Skip to content

Bluesky OAuth callback never reaches the desktop app: redirect scheme and path do not match what Cyd registers #699

Closed

Description

@micahflee

What happens

Completing the X-to-Bluesky migration's OAuth flow never returns to Cyd. The browser ends the redirect chain with:

Prevented navigation to “cyd-dev://bluesky-oauth/?state=REDACTED&iss=https%3A%2F%2Fbsky.social&code=REDACTED” due to an unknown protocol.

The user is left unauthenticated, and no callback ever reaches the app.

(The state and code values are redacted here; an authorization code is an account-control credential.)

Why

The redirect target does not match what the desktop app registers or handles, in both the scheme and the path.

Scheme Path
Redirect sends cyd-dev:// /bluesky-oauth/
Cyd registers/handles social.cyd.dev-api: (prod: social.cyd.api:) /atproto-oauth-callback/

Evidence in this repo:

  • src/main.ts:152-155 — setAsDefaultProtocolClient() registers only social.cyd.api / social.cyd.dev-api.
  • forge.config.ts:141-156,315,328 — packaged .deb/.rpm register only the same two schemes as x-scheme-handler/… mime types. So this is not a dev-run-only gap; a packaged build has no cyd-dev:// handler either.
  • src/main.ts:122-141 — openCydURL() dispatches the Bluesky callback only for pathname /atproto-oauth-callback/. Anything else falls through to the "Invalid Cyd URL" dialog. Nothing in src/ references bluesky-oauth.

The redirect chain

  1. https://bsky.social/oauth/authorize →
  2. https://dev-api.cyd.social/bluesky/redirect — the only entry in redirect_uris in the published client metadata at https://dev-api.cyd.social/bluesky/client-metadata.json, which the app names in BlueskyService.initClient() (src/account_x/controller/bluesky/BlueskyService.ts:128-137) →
  3. https://cyd.social/bluesky-redirect-to-cyd-dev/?state=…&iss=…&code=… →
  4. cyd-dev://bluesky-oauth/?… ← fails here

Steps 2 and 3 live outside this repo, in cyd-server and cyd.social (both private), so the fix is likely there rather than here: the final hop should emit social.cyd.dev-api://atproto-oauth-callback/?… (and social.cyd.api://atproto-oauth-callback/?… for prod).

Worth deciding deliberately rather than just patching the string: whether the desktop should also accept cyd-dev:// / cyd:// for compatibility, and whether the scheme and path belong in one shared constant instead of being spelled out independently in three places across three repos.

Reproduce

  1. Run Cyd dev and add an X account.
  2. X wizard → Migrate to Bluesky → Connect, and complete authorization at Bluesky.
  3. The browser refuses the final navigation; Cyd stays disconnected.

Impact

The X-to-Bluesky migration cannot be connected at all through the normal flow. It also blocks the manual verification checklist in docs/security/credential-store.md for #671 / #698, whose "Connect" steps all assume the callback arrives. Injecting the query string directly into X:blueskyCallback from the renderer console exercises the credential-store write path, but is not a substitute for testing the real flow.

(This was written by an LLM.)

Activity

  1. micahflee commented on Sep 11, 2026

    @micahflee
    MemberAuthor

    Folded into #674.

    The fix belongs with the shared Bluesky OAuth work rather than beside it. #674 now unifies the X migration's OAuth and the Bluesky platform's OAuth into one module with a DID-keyed credential store, and the callback scheme and path become a single shared constant — which is the deliberate fix this issue asked for instead of patching the string in three places.

    The cross-repo hops in cyd-server and cyd.social are carried as an acceptance criterion there, along with an end-to-end authorization actually reaching the app. The analysis in this issue stays the reference for that work.

    (This was written by an LLM.)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions