-
Notifications
You must be signed in to change notification settings - Fork 46
Add SpanContext support to PasskeyWebListener and WebViewAuthorizationFragment, Fixes AB#3470497 #2850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
|
❌ Work item link check failed. Description does not contain AB#{ID}. Click here to Learn more. |
|
✅ Work item link check complete. Description contains link AB#3470497 to an Azure Boards work item. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances observability for the passkey authentication flow by adding OpenTelemetry SpanContext support. The changes enable trace context propagation from the AuthorizationActivity through PasskeyWebListener to PasskeyReplyChannel, allowing passkey operations to be properly traced as child spans in the telemetry hierarchy.
Key changes:
- Added
SpanContextparameter toPasskeyWebListenerconstructor andhook()method - Updated the single call site in
WebViewAuthorizationFragmentto extract and pass theSpanContextfromAuthorizationActivity - Propagated
SpanContextto allPasskeyReplyChannelinstantiations withinPasskeyWebListener
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
PasskeyWebListener.kt |
Added spanContext parameter to constructor, updated hook() method signature, and forwarded SpanContext to all PasskeyReplyChannel instantiations for proper trace propagation |
WebViewAuthorizationFragment.java |
Retrieves SpanContext from AuthorizationActivity and passes it to PasskeyWebListener.hook() to enable telemetry context propagation |
.../src/main/java/com/microsoft/identity/common/internal/providers/oauth2/PasskeyWebListener.kt
Outdated
Show resolved
Hide resolved
.../src/main/java/com/microsoft/identity/common/internal/providers/oauth2/PasskeyWebListener.kt
Show resolved
Hide resolved
| "Received WebAuthN request of type: ${webAuthNMessage.type} from origin: $sourceOrigin" | ||
| ) | ||
| val passkeyReplyChannel = PasskeyReplyChannel(javaScriptReplyProxy, webAuthNMessage.type) | ||
| val passkeyReplyChannel = PasskeyReplyChannel( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is spanContext then being used to parent the new span?
This pull request enhances the passkey authentication flow by adding support for OpenTelemetry tracing via
SpanContextpropagation. The main changes involve updating thePasskeyWebListenerand related setup to accept and pass along aSpanContext, enabling better observability and traceability for passkey-related operations.Tracing and observability improvements:
PasskeyWebListenerconstructor and all relevant call sites to accept an optionalSpanContext, allowing trace context propagation throughout the passkey authentication process. [1] [2] [3] [4]PasskeyReplyChannelwithinPasskeyWebListenerto forward theSpanContext, ensuring that trace information is included in downstream operations. [1] [2]io.opentelemetry.api.trace.SpanContextinPasskeyWebListener.kt.AB#3470497