Add MSI token revocation support for legacy sources #5139
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.
Fixes #5138
Changes proposed in this request
This pull request includes several changes to the
Microsoft.Identity.Client
library to support claims and capabilities in managed identity requests. The most important changes involve adding a newClaims
property, modifying request creation methods to include this property, and implementing a new method to apply claims and capabilities to requests.Support for Claims and Capabilities:
src/client/Microsoft.Identity.Client/ApiConfig/Parameters/AcquireTokenForManagedIdentityParameters.cs
: Added a newClaims
property to theAcquireTokenForManagedIdentityParameters
class.src/client/Microsoft.Identity.Client/Internal/Requests/ManagedIdentityAuthRequest.cs
: Updated theExecuteAsync
method to set theClaims
property in_managedIdentityParameters
.Request Creation and Handling:
src/client/Microsoft.Identity.Client/ManagedIdentity/AbstractManagedIdentity.cs
: Modified theCreateRequest
method to acceptAcquireTokenForManagedIdentityParameters
and added theApplyClaimsAndCapabilities
method to set request parameters based on claims and capabilities. [1] [2] [3]Updated various managed identity source classes (
AppServiceManagedIdentitySource
,AzureArcManagedIdentitySource
,CloudShellManagedIdentitySource
,ImdsManagedIdentitySource
,MachineLearningManagedIdentitySource
,ServiceFabricManagedIdentitySource
) to use the newCreateRequest
method signature and apply claims and capabilities. [1] [2] [3] [4] [5] [6]Testing Enhancements:
tests/Microsoft.Identity.Test.Common/Core/Mocks/MockHttpManagerExtensions.cs
: Enhanced theAddManagedIdentityMockHandler
method to include parameters for enabling capabilities and claims, and updated theBuildMockHandlerForManagedIdentitySource
method accordingly. [1] [2]Testing
unit tests
Performance impact
none
Documentation