Skip to content

Sign in with Touch ID using the saved Apple ID password - #901

Open
mike011 wants to merge 1 commit into
XcodesOrg:mainfrom
mike011:touch-id-login
Open

mike011 wants to merge 1 commit into
XcodesOrg:mainfrom
mike011:touch-id-login

Conversation

@mike011

@mike011 mike011 commented Nov 23, 2026

Copy link
Copy Markdown

Summary

Apple's servers need the Apple ID password, so Touch ID can't replace it entirely. This change lets Touch ID unlock the password Xcodes already saves in the Keychain, so users type it once and use their fingerprint from then on.

  • Offer after sign-in: after a user signs in by typing their password on a Mac with Touch ID, Xcodes asks once: "Use Touch ID next time?"
  • Expired sessions: when the Apple session has expired, Xcodes asks for Touch ID before reusing the saved password, instead of signing in silently.
  • Sign-in window: when Touch ID is on and a password is saved, the window shows Sign in with Touch ID and fills in the saved Apple ID.
  • Fallback: if Touch ID fails, is cancelled, or isn't available, the normal sign-in window is shown. Apple's two-factor code is still requested when Apple requires it.

Details

  • Session checks that happen at the same time (launch restore, list refresh, installs) share one Touch ID prompt.
  • No prompt is shown while the app isn't frontmost (for example, from the auto-install timer).
  • If the user cancels Touch ID at launch, the sign-in window opens.
  • Cancelling the sign-in window closes an open Touch ID prompt, and a result that arrives late is ignored.
  • The offer is only recorded as answered once the user picks an option. It waits until no other alert or sheet is showing, so it doesn't replace an error.
  • Signing out turns Touch ID off and offers it again on the next sign-in. There's no separate Settings switch.
  • Touch ID access goes through a new Biometrics dependency on Environment, mocked in tests.
  • New strings are added to Localizable.xcstrings in English only, so they need translating.

Limitation for maintainers to consider

The Touch ID requirement is enforced by the app, not by macOS: the Keychain item itself isn't protected by biometrics. Making macOS enforce it (SecAccessControl with .biometryCurrentSet) requires the data-protection keychain. That in turn needs a keychain-access-groups / application-identifier entitlement and a provisioning profile, which the app doesn't currently have. Existing saved passwords would also need migrating. That seemed like a signing decision for the maintainers rather than something to change in this PR.

Testing

  • Added unit tests in AppStateTests for: Touch ID success, failure and unavailable; one prompt shared by concurrent callers; no prompt in the background; the sign-in window after a failed prompt at launch; a late result ignored; sign-out resetting Touch ID; and recording the offer answer. The full suite passes (141 tests, 3 skipped).
  • Manually tested on a Mac with Touch ID: signed in, accepted the offer, then deleted ~/Library/HTTPStorages/com.xcodesorg.xcodesapp.binarycookies to simulate Apple expiring the session. On relaunch, Touch ID signed back in without the sign-in window.

🤖 Generated with Claude Code

After a user signs in by typing their password on a Mac with Touch ID,
offer once to use Touch ID next time. When it's on, an expired Apple
session is restored with a Touch ID prompt instead of the sign-in window,
and the sign-in window offers "Sign in with Touch ID".

If Touch ID fails, is cancelled, or isn't available, the normal sign-in
window is shown. Concurrent session checks share one prompt, and no
prompt is shown while the app is in the background. Signing out turns
Touch ID off and offers it again on the next sign-in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant