-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade Azure.Identity to 1.10.3 and other dependencies (#23957)
* Release an Preview Az.Accounts for Updating Az.Identity to 1.10.3 (#23766) * Upgrade Azure.Identity to 1.10.0 Update Azure.Identity.Broker to 1.0.0-beta.5 Migrate Token Cache from Name without Suffix to Name with Suffix Set CAEenabled to true in TokenCredential Fix bugs Update Change Log Fix the issue that token cache cannot be migrated in Mac and Linux Integrate the Source Codes of Azure.Identity 1.10.0 to Enable CAE for Client Assertion Authencation * Try to fix Build Issue * Fix token acquisition error of Service Principal when upgrading Az.Accounts (#23841) #23831 * Polish change log * Address review comments
- Loading branch information
Showing
80 changed files
with
5,089 additions
and
208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/Accounts/Authentication/Identity/AbstractAcquireTokenParameterBuilderExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// ---------------------------------------------------------------------------------- | ||
// | ||
// Copyright Microsoft Corporation | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// ---------------------------------------------------------------------------------- | ||
// | ||
|
||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Microsoft.Identity.Client; | ||
|
||
namespace Microsoft.Azure.PowerShell.Authenticators.Identity | ||
{ | ||
internal static class AbstractAcquireTokenParameterBuilderExtensions | ||
{ | ||
public static async ValueTask<AuthenticationResult> ExecuteAsync<T>(this AbstractAcquireTokenParameterBuilder<T> builder, bool async, CancellationToken cancellationToken) | ||
where T : AbstractAcquireTokenParameterBuilder<T> | ||
{ | ||
Microsoft.Identity.Client.AuthenticationResult result = async | ||
? await builder.ExecuteAsync(cancellationToken).ConfigureAwait(false) | ||
#pragma warning disable AZC0102 // Do not use GetAwaiter().GetResult(). Use the TaskExtensions.EnsureCompleted() extension method instead. | ||
: builder.ExecuteAsync(cancellationToken).GetAwaiter().GetResult(); | ||
#pragma warning restore AZC0102 // Do not use GetAwaiter().GetResult(). Use the TaskExtensions.EnsureCompleted() extension method instead. | ||
|
||
return result; | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/Accounts/Authentication/Identity/AuthenticationAccount.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// | ||
// Copyright Microsoft Corporation | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// ---------------------------------------------------------------------------------- | ||
// | ||
using Microsoft.Identity.Client; | ||
|
||
namespace Microsoft.Azure.PowerShell.Authenticators.Identity | ||
{ | ||
internal class AuthenticationAccount : IAccount | ||
{ | ||
private AuthenticationRecord _profile; | ||
|
||
internal AuthenticationAccount(AuthenticationRecord profile) | ||
{ | ||
_profile = profile; | ||
} | ||
|
||
string IAccount.Username => _profile.Username; | ||
|
||
string IAccount.Environment => _profile.Authority; | ||
|
||
AccountId IAccount.HomeAccountId => _profile.AccountId; | ||
|
||
public static explicit operator AuthenticationAccount(AuthenticationRecord profile) => new AuthenticationAccount(profile); | ||
public static explicit operator AuthenticationRecord(AuthenticationAccount account) => account._profile; | ||
} | ||
} |
Oops, something went wrong.