Skip to content

Add extensibility APIs#5573

Merged
neha-bhargava merged 34 commits intomainfrom
nebharg/certExtensibility
Dec 18, 2025
Merged

Add extensibility APIs#5573
neha-bhargava merged 34 commits intomainfrom
nebharg/certExtensibility

Conversation

@neha-bhargava
Copy link
Contributor

Fixes #5568

Changes proposed in this request

  • Create the extensibility apis for dynamic cert, retry and observer

Testing

Performance impact

Documentation

  • All relevant documentation is updated.

@neha-bhargava neha-bhargava requested a review from a team as a code owner November 7, 2025 23:17
@neha-bhargava neha-bhargava marked this pull request as draft November 7, 2025 23:17
Copy link
Contributor

Copilot AI left a 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 introduces extensibility APIs for client credential flows, enabling dynamic certificate provisioning, custom retry logic for service failures, and execution observation. The changes support scenarios like certificate rotation from Azure Key Vault and custom telemetry collection.

  • Dynamic certificate provider callback that's invoked before each token request
  • Retry callback for handling service failures with custom logic
  • Execution observer for tracking token acquisition results (success or failure)

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
src/client/Microsoft.Identity.Client/Extensibility/ClientCredentialExtensionParameters.cs New parameter class providing application context to extensibility callbacks
src/client/Microsoft.Identity.Client/Extensibility/ExecutionResult.cs New result class containing either successful AuthenticationResult or exception
src/client/Microsoft.Identity.Client/Extensibility/ConfidentialClientApplicationBuilderExtensions.cs Extension methods for WithCertificate, OnMsalServiceFailure, and OnSuccess
src/client/Microsoft.Identity.Client/AppConfig/ApplicationConfiguration.cs Adds storage for three new extensibility callback properties
src/client/Microsoft.Identity.Client/Internal/Requests/ClientCredentialRequest.cs Implements retry loop and callback invocation logic for token acquisition
src/client/Microsoft.Identity.Client/Internal/ClientCredential/CertificateAndClaimsClientCredential.cs Adds dynamic certificate resolution via provider callback
src/client/Microsoft.Identity.Client/ApiConfig/AbstractConfidentialClientAcquireTokenParameterBuilder.cs Updates validation to allow dynamic certificate provider
src/client/Microsoft.Identity.Client/MsalError.cs Adds error constant for invalid client credential configuration
tests/Microsoft.Identity.Test.Unit/PublicApiTests/ConfidentialClientApplicationExtensibilityTests.cs Comprehensive integration tests for all three extensibility points
tests/Microsoft.Identity.Test.Unit/AppConfigTests/ConfidentialClientApplicationExtensibilityApiTests.cs Unit tests for builder API and configuration storage
src/client/Microsoft.Identity.Client/PublicApi/*/PublicAPI.Unshipped.txt Documents new public API surface for all target frameworks
src/client/Microsoft.Identity.Client/Microsoft.Identity.Client.csproj Adds new extensibility files to project
src/client/Microsoft.Identity.Client/ManagedIdentity/AbstractManagedIdentity.cs Modifies exception handling pattern (appears unrelated to extensibility)

neha-bhargava and others added 2 commits November 14, 2025 14:33
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@neha-bhargava neha-bhargava marked this pull request as ready for review November 14, 2025 22:34
@neha-bhargava neha-bhargava self-assigned this Nov 14, 2025
@neha-bhargava neha-bhargava marked this pull request as draft November 17, 2025 21:15
@neha-bhargava neha-bhargava marked this pull request as ready for review November 17, 2025 21:45
This was referenced Jan 10, 2026
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.

[Feature Request] Add 3 new extensiblity APIs

4 participants