Repository navigation
feat: accept passkeys from Android apps by their signing certificate - #14353
Conversation
Native Android apps send android:apk-key-hash:<base64url SHA-256 of the signing certificate> as the WebAuthn origin, so passkeys created in an app were rejected. Android platforms now take the SHA-256 fingerprints of their signing certificates, and each becomes an allowed origin on the relying party.
|
Review complete. 🟡 1 medium 💬 Inline comments (1)
This PR wires Android app signing-certificate fingerprints through the platform lifecycle: the
Reviewed commit: bd49cef |
🟢 Tier S · Ready to merge
Android platforms can now store validated SHA-256 signing-certificate fingerprints, which are converted into Android passkey origins and exposed through platform responses. The PR adds the platform schema and migration, Android platform API handling, and unit and end-to-end coverage for validation, persistence, and passkey origin matching. Latest changes: The latest commit marks Android fingerprints as required in the response model and adds a regression test confirming legacy platform documents serialize a missing fingerprint list as empty.
📂 Walkthrough · 13
Reviewed the commits since |
Security rulesNo new WARNING or ERROR findings from security rules. 32 existing findings tracked in
|
There was a problem hiding this comment.
Adds Android SHA-256 certificate fingerprints to platform endpoints, passkey WebAuthn origin derivation, the platform schema with a V25 migration, and a Fingerprint validator with tests.
Key findings
- 🟡 Legacy Android platforms serialize
fingerprintsas null, not [] — PlatformAndroid.php:26
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
Android platforms created before this attribute have no fingerprints, so the rule is explicitly required to make Response::output() fill in the [] default instead of null.
Brings in Android passkey origins (#14353) and membership delete events for the removed member (#14210). Ported to database 8.0: the platforms fingerprints attribute as Attribute::string, and Id in place of ID in the realtime adapter and the new tests. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Passkeys created in an Android app are accepted once its signing certificate fingerprint is on the platform (appwrite#14353). The app drawer edits them, and the passkey preview and origin list show the Android origins.
What does this PR do?
Passkeys now work in native Android apps.
Why it failed before: Android apps don't send a web origin like
https://example.com. They send a hash of the certificate the app is signed with. We only allowed web origins and the Apple origin, so every passkey from an Android app was rejected.What changed:
fingerprintsfield: Android platforms take an optional list of the app's SHA-256 signing certificate fingerprints, as shown in Play Console or by./gradlew signingReport. Most apps have more than one: debug, upload and the Play App Signing key.originslist, next to the web and Apple ones.fingerprintsout keeps the current list, and an empty list clears it.fingerprintsattribute on theplatformscollection, added to the V25 migration.What the developer still does: host
/.well-known/assetlinks.jsonon their domain, listing the app as allowed to use its passkeys. iOS already works this way withapple-app-site-association.Verified on an Android emulator
An Android 16 emulator ran the real Credential Manager against a local Appwrite built from this branch. The test app is signed with the debug key from Google's identity-samples, and the relying party is
project-sesame-426206.appspot.com, whoseassetlinks.jsonalready trusts that key. The passkey provider is Google's MyVault sample, which checks those asset links.Before fingerprints are added: the app gets a challenge and the device creates the passkey, but Appwrite rejects the app's origin.
After the fingerprint
4F:20:47:…:FA:11is added to the Android platform: the policy's origins includeandroid:apk-key-hash:TyBHH9maupZHjVknwsim6o7SjRTAtqI5mZ-jTUc9-hE, the exact origin the device sends.Test Plan
testAndroidAppSignIn: a passkey from the app is rejected until fingerprints are added. After that it signs in from the release build, the debug build and the website. Other signing keys and broken hashes are still rejected. This test fails without the fix.testAndroidPlatformFingerprints: creating and updating fingerprints, keeping or clearing them, uppercasing, removing duplicates and rejecting invalid formats.react-native-androidplatforms, and exact origin matching in the library.Follow-ups
platforms.fingerprintsattribute before release (appwrite-labs/cloud#6473)Related: appwrite-labs/cloud#5805