Skip to content

Commit 3f3e61b

Browse files
Update Azure.Identity (#19547)
* Update Azure.Identity * Update ChangeLog.md * Update after review Co-authored-by: Yunchi Wang <[email protected]>
1 parent b48051b commit 3f3e61b

25 files changed

+14
-1747
lines changed

src/Accounts/Accounts/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
## Upcoming Release
2222
* Supported tenant domain as input while using `Connect-AzAccount` with parameter `Tenant`. [#19471]
23+
* Upgraded Azure.Identity to 1.6.1
2324
* Changed target framework of AuthenticationAssemblyLoadContext to netcoreapp3.1.
2425

2526
## Version 2.10.1

src/Accounts/Authentication/Authentication.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</PropertyGroup>
1313

1414
<ItemGroup>
15-
<PackageReference Include="Azure.Identity" Version="1.6.0" />
15+
<PackageReference Include="Azure.Identity" Version="1.6.1" />
1616
</ItemGroup>
1717

1818
<ItemGroup>

src/Accounts/Authentication/Utilities/CustomAssemblyResolver.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public static class CustomAssemblyResolver
2525
new Dictionary<string, Version>(StringComparer.InvariantCultureIgnoreCase)
2626
{
2727
{"Azure.Core", new Version("1.25.0.0")},
28+
{"Azure.Identity", new Version("1.6.1.0")},
2829
{"Microsoft.Bcl.AsyncInterfaces", new Version("1.1.1.0")},
2930
{"Microsoft.Identity.Client", new Version("4.39.0.0") },
3031
{"Microsoft.Identity.Client.Extensions.Msal", new Version("2.19.3.0") },

src/Accounts/AuthenticationAssemblyLoadContext/AzAssemblyLoadContextInitializer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ static AzAssemblyLoadContextInitializer()
3232
var azSharedAssemblies = new Dictionary<string, Version>()
3333
{
3434
{"Azure.Core", new Version("1.25.0.0")},
35-
{"Azure.Identity", new Version("1.6.0.0")},
35+
{"Azure.Identity", new Version("1.6.1.0")},
3636
{"Microsoft.Bcl.AsyncInterfaces", new Version("1.1.1.0")},
3737
{"Microsoft.Identity.Client", new Version("4.39.0.0") },
3838
{"Microsoft.Identity.Client.Extensions.Msal", new Version("2.19.3.0") },

src/Accounts/Authenticators/Authenticators.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
<DefineConstants>TRACE;RELEASE;NETSTANDARD;SIGN</DefineConstants>
2323
</PropertyGroup>
2424

25-
<ItemGroup>
26-
<PackageReference Include="Azure.Identity" Version="1.6.0" />
27-
</ItemGroup>
28-
2925
<ItemGroup>
3026
<ProjectReference Include="..\Authentication\Authentication.csproj" />
3127
</ItemGroup>

src/Accounts/Authenticators/ClientAssertionAuthenticator.cs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,15 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15-
using System;
16-
using System.Security.Cryptography.X509Certificates;
17-
using System.Threading;
18-
using System.Threading.Tasks;
19-
2015
using Azure.Core;
2116
using Azure.Identity;
2217
using Microsoft.Azure.Commands.Common.Authentication;
2318
using Microsoft.Azure.Commands.Common.Authentication.Abstractions;
2419
using Microsoft.Azure.PowerShell.Authenticators.Factories;
2520
using Microsoft.WindowsAzure.Commands.Common;
26-
using Microsoft.Identity.Client;
27-
using Microsoft.Azure.PowerShell.Authenticators.Identity;
28-
using ClientAssertionCredential = Microsoft.Azure.PowerShell.Authenticators.Identity.ClientAssertionCredential;
21+
using System;
22+
using System.Threading;
23+
using System.Threading.Tasks;
2924

3025
namespace Microsoft.Azure.PowerShell.Authenticators
3126
{
@@ -45,7 +40,7 @@ public override Task<IAccessToken> Authenticate(AuthenticationParameters paramet
4540
var requestContext = new TokenRequestContext(scopes);
4641
AzureSession.Instance.TryGetComponent(nameof(AzureCredentialFactory), out AzureCredentialFactory azureCredentialFactory);
4742

48-
TokenCredential tokenCredential = new ClientAssertionCredential(tenantId, spParameters.ClientId, spParameters.ClientAssertion.ConvertToString());
43+
TokenCredential tokenCredential = new ClientAssertionCredential(tenantId, spParameters.ClientId, () => GetClientAssertion(spParameters));
4944
string parametersLog = $"- ClientId:'{spParameters.ClientId}', TenantId:'{tenantId}', ClientAssertion:'***' Scopes:'{string.Join(",", scopes)}'";
5045
return MsalAccessToken.GetAccessTokenAsync(
5146
nameof(ClientAssertionAuthenticator),
@@ -61,5 +56,11 @@ public override bool CanAuthenticate(AuthenticationParameters parameters)
6156
{
6257
return (parameters as ClientAssertionParameters) != null;
6358
}
59+
60+
private string GetClientAssertion(ClientAssertionParameters parameters)
61+
{
62+
return parameters.ClientAssertion.ConvertToString();
63+
}
64+
6465
}
6566
}

src/Accounts/Authenticators/Identity/AsyncLockWithValue.cs

Lines changed: 0 additions & 194 deletions
This file was deleted.

0 commit comments

Comments
 (0)