Repository navigation
Conversation
|
This is very cool, thank you very much for working on this! I see a lot of example code and tests, but no additions or changes to the library itself. It's awesome that you got this working, but I feel like it would be more useful for end users if FIDO auth was integrated into the library itself. There are existing base classes for this (e.g. Do you think you could retrofit your solution into the existing 2FA model? Or would we need API changes / additions to properly implement this? |
|
Yes, I agree that native integration would be much more useful for end users. I think the protocol can be retrofitted into the existing 2FA model, but not cleanly through the current My preferred approach would be a small, backward-compatible API addition:
I would avoid forcing the assertion through So the short answer is: yes, I can rework this into the library's 2FA model, but I recommend a small additive API extension rather than fitting it into the code-based interface unchanged. If that direction works for you, I can retrofit the PR around it. |
Refs malmeloo#159. Opt-in Linux HSA2 FIDO2/WebAuthn adapter, checked authentication transport, private CLI and synthetic tests. No default SDK API changes. Coding-Model: gpt-6-astra
Move the proven HSA2 challenge, assertion, and authentication flow into FindMy's native BaseSecondFactorMethod model with async and sync APIs. Keep python-fido2 optional through a signer callback, preserve code-based factors, bound the 2FA transport, and update docs/tests. Coding-Model: gpt-5.6-sol-900k
3ad09f3 to
58b5c84
Compare
|
Thanks — I reworked the PR around the existing second-factor model as suggested. The native library now exposes The Apple HSA2 parser, assertion codec, continuation handling, bounded verified-TLS 2FA transport and post-key GrandSlam/MobileMe transitions are now in Verification on the rebased branch: 173 tests passed on Python 3.10–3.14, Ruff, basedpyright and pre-commit passed, and the built wheel contains the native security-key modules. I also kept the real-account evidence and universal-compatibility limitations explicit in the PR description; no account data or session material is included. |
|
Thanks, I agree that this is probably the correct approach. I can't review your changes in detail right now so give me some time to look into it. One more thing: I'd suggest that we drop the current example additions entirely. It doesn't add a whole lot to the library (they appear to bypass the library entirely), and while it's certainly interesting, I think it serves more as documentation on how the spec works. It definitely has a purpose somewhere (dedicated FindMy docs, anyone???), but probably not in this library. |
|
Thanks, I've removed the example additions as requested and updated the PR. |
Summary
Related to #159 and parawanderer/OpenTagViewer#18.
Integrates Apple HSA2 hardware-security-key authentication into FindMy.py's existing second-factor model.
SecurityKeyChallengeandSecurityKeyAssertionvalue types.get_2fa_methods().authenticate(signer)instead of forcing an assertion throughsubmit(code: str).BaseAppleAccountimplementations compatible.Review follow-up
Removed the standalone security-key example additions as requested. Removed their dependency/configuration changes and obsolete documentation links. The native implementation is unchanged from the previous revision; this PR now contains only library integration and the corresponding account/API documentation.
Validation
Offline validation of native authentication APIs, compatibility and rejection guards passed on Python 3.10, 3.11, 3.12, 3.13 and 3.14. Ruff, basedpyright and all configured pre-commit checks passed. The source distribution and wheel build successfully. A separately installed wheel was exercised without
python-fido2, including the native async account flow and synchronous security-key factor using synthetic data. The HTML documentation build succeeds with warnings outside the edited account page, including missing local Graphviz support.Evidence and limitations
The original adapter completed login on one real Apple Account protected by a Yubico USB Security Key on Linux, and the resulting FindMy session was subsequently reused. The extracted native integration has been validated offline; this cleanup does not add a new real-account or hardware trial.
This is experimental. It does not claim universal hardware/account compatibility, official Apple support, legacy FSA1/U2F support, or primary-FSA2/passwordless login. No account-security changes, key removal or weaker fallback were used. No private account data, sessions, tokens, accessory exports, locations or homelab configuration are included.
Contributed by Olafejs with AI-assisted implementation and validation. Existing FindMy.py code and dependencies retain their authorship and licenses; this contribution follows the repository's MIT license.