Enhance WebAuthn telemetry for passkey registration, Fixes AB#3540659#3018
Open
Enhance WebAuthn telemetry for passkey registration, Fixes AB#3540659#3018
Conversation
…ration for passkey operations
|
❌ Work item link check failed. Description does not contain AB#{ID}. Click here to Learn more. |
Contributor
Author
|
@copilot REVIEW |
Contributor
Contributor
There was a problem hiding this comment.
Pull request overview
Enhances passkey/WebAuthn registration telemetry by introducing new OpenTelemetry attributes (origin, AAGUID) and plumbing extraction logic from WebAuthn registration responses into the passkey reply path.
Changes:
- Added new OTel attribute keys:
passkey_originandpasskey_aaguid. - Added WebAuthn JSON constants and implemented origin/AAGUID extraction helpers (with tests).
- Updated passkey WebView integration to ensure credential operations run on
Dispatchers.Main, and added async telemetry enrichment after JS replies.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| common4j/src/main/com/microsoft/identity/common/java/opentelemetry/AttributeName.java | Adds new telemetry attribute keys for origin + AAGUID. |
| common4j/src/main/com/microsoft/identity/common/java/constants/FidoConstants.kt | Adds WebAuthn registration JSON keys and AAGUID offset/length constants. |
| common/src/main/java/com/microsoft/identity/common/internal/fido/WebAuthnJsonUtil.kt | Converts util to object and adds extraction helpers for origin + AAGUID from registration response/attestation. |
| common/src/test/java/com/microsoft/identity/common/internal/fido/WebAuthnJsonUtilTest.kt | Adds unit tests for new origin/AAGUID extraction helpers. |
| common/src/main/java/com/microsoft/identity/common/internal/providers/oauth2/PasskeyWebListener.kt | Updates docs and ensures coroutine scope uses Dispatchers.Main for CredentialManager UI. |
| common/src/main/java/com/microsoft/identity/common/internal/providers/oauth2/PasskeyReplyChannel.kt | Posts JS reply immediately, then asynchronously enriches telemetry with origin/AAGUID. |
| common/src/main/java/com/microsoft/identity/common/internal/fido/LegacyFidoActivityResultContract.kt | Updates import to match WebAuthnJsonUtil conversion to object. |
common4j/src/main/com/microsoft/identity/common/java/opentelemetry/AttributeName.java
Show resolved
Hide resolved
...src/main/java/com/microsoft/identity/common/internal/providers/oauth2/PasskeyReplyChannel.kt
Outdated
Show resolved
Hide resolved
...src/main/java/com/microsoft/identity/common/internal/providers/oauth2/PasskeyReplyChannel.kt
Outdated
Show resolved
Hide resolved
...src/main/java/com/microsoft/identity/common/internal/providers/oauth2/PasskeyReplyChannel.kt
Outdated
Show resolved
Hide resolved
common/src/main/java/com/microsoft/identity/common/internal/fido/WebAuthnJsonUtil.kt
Outdated
Show resolved
Hide resolved
common/src/main/java/com/microsoft/identity/common/internal/fido/WebAuthnJsonUtil.kt
Outdated
Show resolved
Hide resolved
common/src/main/java/com/microsoft/identity/common/internal/fido/WebAuthnJsonUtil.kt
Outdated
Show resolved
Hide resolved
common/src/main/java/com/microsoft/identity/common/internal/fido/WebAuthnJsonUtil.kt
Outdated
Show resolved
Hide resolved
...src/main/java/com/microsoft/identity/common/internal/providers/oauth2/PasskeyReplyChannel.kt
Outdated
Show resolved
Hide resolved
common4j/src/main/com/microsoft/identity/common/java/opentelemetry/AttributeName.java
Show resolved
Hide resolved
...src/main/java/com/microsoft/identity/common/internal/providers/oauth2/PasskeyReplyChannel.kt
Outdated
Show resolved
Hide resolved
...src/main/java/com/microsoft/identity/common/internal/providers/oauth2/PasskeyReplyChannel.kt
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…ebListener by adding context handling and baggage support
|
✅ Work item link check complete. Description contains link AB#3540659 to an Azure Boards work item. |
|
❌ Invalid work item number: AB#3540659 Click here to learn more. |
melissaahn
approved these changes
Mar 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The purpose of this PR is to extract additional telemetry (passkey_aaguid and passkey_origin) from successful PasskeyWebListener scenarios. This will help us investigate an error observed in MSAL STS, where the origin is not in the expected format. We want to determine whether this issue is caused by our code or by a malicious app. If it originates from our side, we aim to identify the conditions under which it occurs, such as specific device models, OEMs, or passkey providers.
WebAuthn Passkey Registration & Extraction Enhancements
WebAuthnJsonUtilfor extracting the origin and AAGUID from passkey registration responses, including robust parsing of CBOR-encoded attestation objects and error handling. These utilities help with downstream identity and device management.WebAuthnJsonUtilfrom aclasswith acompanion objectto a singletonobject, and updated method signatures for improved clarity and usage. [1] [2] [3] [4]WebAuthnJsonUtilto reference individual fields fromFidoConstants.Companion, improving code readability and maintainability.OpenTelemetry Integration
opentelemetry-extension-kotlindependency, enabling better integration of OpenTelemetry with Kotlin coroutines and context propagation.PasskeyReplyChannelto accept an OpenTelemetryContextand a coroutine scope for telemetry, allowing asynchronous telemetry recording and improved tracing. [1] [2] [3]getOtelContext()method toAuthorizationActivityfor safe access to the OpenTelemetry context extracted from intent extras.Code Quality & Maintenance
PasskeyReplyChannel, supporting more detailed trace and span metadata.android_spans
| where span_name == "PasskeyWebListener"
| project calling_package_name, DeviceInfo_Model, active_broker_package_name, DeviceInfo_Make, account_type, passkey_aaguid, passkey_origin
|take 1000
AB#3540659
related PR: https://github.com/identity-authnz-teams/ad-accounts-for-android/pull/107