Skip to content

Commit 191d1f0

Browse files
committed
Add token revocation support for App Service
1 parent e118a9f commit 191d1f0

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

src/client/Microsoft.Identity.Client/ManagedIdentity/AppServiceManagedIdentitySource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace Microsoft.Identity.Client.ManagedIdentity
1414
internal class AppServiceManagedIdentitySource : AbstractManagedIdentity
1515
{
1616
// MSI Constants. Docs for MSI are available here https://docs.microsoft.com/azure/app-service/overview-managed-identity
17-
private const string AppServiceMsiApiVersion = "2019-08-01";
17+
private const string AppServiceMsiApiVersion = "2025-03-30";
1818
private const string SecretHeaderName = "X-IDENTITY-HEADER";
1919

2020
private readonly Uri _endpoint;

src/client/Microsoft.Identity.Client/ManagedIdentity/ManagedIdentitySourceExtensions.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ internal static class ManagedIdentitySourceExtensions
99
{
1010
private static readonly HashSet<ManagedIdentitySource> s_supportsClaimsAndCaps =
1111
[
12-
// add other sources here as they light up
13-
ManagedIdentitySource.ServiceFabric,
12+
// add other sources here as they light up
13+
ManagedIdentitySource.ServiceFabric,
14+
ManagedIdentitySource.AppService
1415
];
1516

1617
internal static bool SupportsClaimsAndCapabilities(

tests/Microsoft.Identity.Test.Common/Core/Mocks/MockHttpManagerExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ private static MockHttpMessageHandler BuildMockHandlerForManagedIdentitySource(
447447
{
448448
case ManagedIdentitySource.AppService:
449449
httpMessageHandler.ExpectedMethod = HttpMethod.Get;
450-
expectedQueryParams.Add("api-version", "2019-08-01");
450+
expectedQueryParams.Add("api-version", "2025-03-30");
451451
expectedQueryParams.Add("resource", resource);
452452
expectedRequestHeaders.Add("X-IDENTITY-HEADER", "secret");
453453
break;

tests/Microsoft.Identity.Test.Integration.netcore/HeadlessTests/ManagedIdentityTests.NetFwk.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,10 @@ public async Task AcquireMSITokenWithClaimsAsync(
414414
// Token source should now be IdentityProvider again
415415
Assert.AreEqual(TokenSource.IdentityProvider,
416416
result3.AuthenticationResultMetadata.TokenSource);
417+
418+
// The new access token (with claims) must be different than the initial one
419+
Assert.AreNotEqual(result1.AccessToken, result3.AccessToken,
420+
"Claims challenge should result in a new access token different from the initial one.");
417421
}
418422
}
419423

0 commit comments

Comments
 (0)