microsoft-authentication-library-common-for-android icon indicating copy to clipboard operation
microsoft-authentication-library-common-for-android copied to clipboard

Add passkey registration support for WebView, Fixes AB#3385532

Open p3dr0rv opened this issue 3 months ago • 3 comments

AB#3385532 https://identitydivision.visualstudio.com/DevEx/_git/AuthLibrariesApiReview/pullrequest/20357

This PR implements passkey registration support for MSAL/Broker/OneAuth on Android WebView through a WebMessageListener bridge. It extends the existing authentication-only passkey functionality to include full registration capabilities, leveraging the standard Android Credential Manager.

🎯 Key Features Protocol Version Update

  • Current: x-ms-PassKeyAuth: 1.0/passkey (authentication only)
  • New: x-ms-PassKeyAuth: 1.1/passkey (registration + authentication)

Passkey and Credential Manager Integration:

  • Added new CredentialManagerHandler class to encapsulate passkey creation and retrieval using the Android Credential Manager API, including version checks and logging. This simplifies and centralizes interactions with the credential APIs.
  • Introduced PasskeyReplyChannel class to standardize communication of WebAuthn responses (success and error) back to JavaScript via JavaScriptReplyProxy, with detailed error mapping to DOMException types per the WebAuthn specification.

Protocol Version Handling:

  • Updated protocol version validation in FidoChallengeField to accept both 1.0 and 1.1 as supported passkey protocol versions, improving compatibility with newer protocol versions.

Dependency Management:

  • Added androidx.webkit:webkit as a dependency to support enhanced WebView and JavaScript interaction features.

Telemetry will be added in following PR

p3dr0rv avatar Sep 23 '25 01:09 p3dr0rv

❌ Work item link check failed. Description does not contain AB#{ID}.

Click here to Learn more.

github-actions[bot] avatar Sep 23 '25 01:09 github-actions[bot]

✅ Work item link check complete. Description contains link AB#3385532 to an Azure Boards work item.

github-actions[bot] avatar Oct 23 '25 06:10 github-actions[bot]

Assemble consumers will fail because webkit version is not defined in those libraries yet.

p3dr0rv avatar Oct 23 '25 21:10 p3dr0rv