Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Microsoft.Identity.Client.ManagedIdentity
internal class AppServiceManagedIdentitySource : AbstractManagedIdentity
{
// MSI Constants. Docs for MSI are available here https://docs.microsoft.com/azure/app-service/overview-managed-identity
private const string AppServiceMsiApiVersion = "2019-08-01";
private const string AppServiceMsiApiVersion = "2025-03-30";
private const string SecretHeaderName = "X-IDENTITY-HEADER";

private readonly Uri _endpoint;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ internal static class ManagedIdentitySourceExtensions
{
private static readonly HashSet<ManagedIdentitySource> s_supportsClaimsAndCaps =
[
// add other sources here as they light up
ManagedIdentitySource.ServiceFabric,
// add other sources here as they light up
ManagedIdentitySource.ServiceFabric,
ManagedIdentitySource.AppService
];

internal static bool SupportsClaimsAndCapabilities(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ private static MockHttpMessageHandler BuildMockHandlerForManagedIdentitySource(
{
case ManagedIdentitySource.AppService:
httpMessageHandler.ExpectedMethod = HttpMethod.Get;
expectedQueryParams.Add("api-version", "2019-08-01");
expectedQueryParams.Add("api-version", "2025-03-30");
expectedQueryParams.Add("resource", resource);
expectedRequestHeaders.Add("X-IDENTITY-HEADER", "secret");
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,10 @@ public async Task AcquireMSITokenWithClaimsAsync(
// Token source should now be IdentityProvider again
Assert.AreEqual(TokenSource.IdentityProvider,
result3.AuthenticationResultMetadata.TokenSource);

// The new access token (with claims) must be different than the initial one
Assert.AreNotEqual(result1.AccessToken, result3.AccessToken,
"Claims challenge should result in a new access token different from the initial one.");
}
}

Expand Down