Skip to content

fix(passkey): accept Android app passkey origins - #333

Open
artile wants to merge 1 commit into
yielded-dev:mainfrom
artile:fix/simplewebauthn-android-origin
Open

artile wants to merge 1 commit into
yielded-dev:mainfrom
artile:fix/simplewebauthn-android-origin

Conversation

@artile

@artile artile commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

A native Android app can run passkey ceremonies through Android Credential Manager (for example WebAuthn in a WebView, or the Credential Manager API, with the app linked to the RP domain through Digital Asset Links). For these, the client data origin is not an https: URL. It is android:apk-key-hash:<hash>, where <hash> is the base64url SHA-256 of the app signing certificate, without padding (43 characters). The relying party must list this origin to verify the reply. See Android's Create a passkey: verify on the app server, which builds this origin from the certificate fingerprint and tells the server to accept it.

Today validatePasskeyPolicy (@yielded/auth) and validateSimpleWebAuthnProfile (@yielded/auth-simplewebauthn) parse every origin as a URL and require https: on the RP ID host, so a profile that lists the Android origin fails with PasskeyConfigurationError.

This change accepts an origin that matches exactly ^android:apk-key-hash:[A-Za-z0-9_-]{43}$ in both checks. Any other non-URL origin still fails. The origin is still an exact allowlist entry: the verifier compares the client data origin to the configured list as before, and the RP ID hash check does not change.

The rule is a small regex in each package, not a new shared export, to keep the public API the same.

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