File tree Expand file tree Collapse file tree 3 files changed +6
-2
lines changed
src/client/Microsoft.Identity.Client
tests/Microsoft.Identity.Test.Common/Core/Mocks Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ internal static class Constants
45
45
public const string ManagedIdentityClientId2017 = "clientid" ;
46
46
public const string ManagedIdentityObjectId = "object_id" ;
47
47
public const string ManagedIdentityResourceId = "mi_res_id" ;
48
+ public const string ManagedIdentityResourceIdImds = "msi_res_id" ;
48
49
public const string ManagedIdentityDefaultClientId = "system_assigned_managed_identity" ;
49
50
public const string ManagedIdentityDefaultTenant = "managed_identity" ;
50
51
public const string CiamAuthorityHostSuffix = ".ciamlogin.com" ;
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ protected override ManagedIdentityRequest CreateRequest(string resource)
73
73
74
74
case AppConfig . ManagedIdentityIdType . ResourceId :
75
75
_requestContext . Logger . Info ( "[Managed Identity] Adding user assigned resource id to the request." ) ;
76
- request . QueryParameters [ Constants . ManagedIdentityResourceId ] = _requestContext . ServiceBundle . Config . ManagedIdentityId . UserAssignedId ;
76
+ request . QueryParameters [ Constants . ManagedIdentityResourceIdImds ] = _requestContext . ServiceBundle . Config . ManagedIdentityId . UserAssignedId ;
77
77
break ;
78
78
79
79
case AppConfig . ManagedIdentityIdType . ObjectId :
Original file line number Diff line number Diff line change @@ -392,7 +392,10 @@ public static void AddManagedIdentityMockHandler(
392
392
393
393
if ( userAssignedIdentityId == UserAssignedIdentityId . ResourceId )
394
394
{
395
- httpMessageHandler . ExpectedQueryParams . Add ( Constants . ManagedIdentityResourceId , userAssignedId ) ;
395
+ httpMessageHandler . ExpectedQueryParams . Add (
396
+ managedIdentitySourceType == ManagedIdentitySource . Imds ?
397
+ Constants . ManagedIdentityResourceIdImds : Constants . ManagedIdentityResourceId ,
398
+ userAssignedId ) ;
396
399
}
397
400
398
401
if ( userAssignedIdentityId == UserAssignedIdentityId . ObjectId )
You can’t perform that action at this time.
0 commit comments