-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix: In claims configuration page, the values in the list of "PickerEntity metadata" was not populated correctly, which caused an issue with the "Title" (and a few others) * Fix: Ensure augmentation can continue even if a tenant has a problem * Reorganize AzureCP.csproj file * Add a link to the privacy policy * Explicitly set build property DependsOnNETStandard to false to try to get rid of occasional FileNotFoundException error "Could not load file or assembly 'netstandard, Version=2.0.0.0" * Update NuGet package Microsoft.Graph to 3.35 * Update NuGet package Microsoft.Identity.Client to 4.42.1 * Update NuGet package Nito.AsyncEx to 5.1.2 * Update NuGet package NUnit to 3.13.3 * Update NuGet package NUnit3TestAdapter to 4.2.1
- Loading branch information
Showing
13 changed files
with
127 additions
and
60 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -757,13 +757,23 @@ protected async Task<List<SPClaim>> GetGroupMembershipFromAzureADAsync(Operation | |
// URL encode the filter to prevent that it gets truncated like this: "UserPrincipalName eq 'guest_contoso.com" instead of "UserPrincipalName eq 'guest_contoso.com#EXT#@TENANT.onmicrosoft.com'" | ||
string filter = HttpUtility.UrlEncode($"{currentContext.IncomingEntityClaimTypeConfig.DirectoryObjectProperty} eq '{currentContext.IncomingEntity.Value}'"); | ||
|
||
// https://github.com/Yvand/AzureCP/issues/78 | ||
// In this method, awaiting on the async task hangs in some scenario (reproduced only in multi-server 2019 farm in the w3wp of a site while using "check permissions" feature) | ||
// Workaround: Instead of awaiting on the async task directly, run it in a parent task, and await on the parent task. | ||
//IGraphServiceUsersCollectionPage userResult = await tenant.GraphService.Users.Request().Filter(filter).GetAsync().ConfigureAwait(false); | ||
IGraphServiceUsersCollectionPage userResult = await Task.Run(() => tenant.GraphService.Users.Request().Filter(filter).GetAsync()).ConfigureAwait(false); | ||
User user = userResult.FirstOrDefault(); | ||
// Do this operation in a try/catch, so if current tenant throws an exception (e.g. secret is expired), execution can still continue for other tenants | ||
IGraphServiceUsersCollectionPage userResult = null; | ||
try | ||
{ | ||
// https://github.com/Yvand/AzureCP/issues/78 | ||
// In this method, awaiting on the async task hangs in some scenario (reproduced only in multi-server 2019 farm in the w3wp of a site while using "check permissions" feature) | ||
// Workaround: Instead of awaiting on the async task directly, run it in a parent task, and await on the parent task. | ||
// userResult = await tenant.GraphService.Users.Request().Filter(filter).GetAsync().ConfigureAwait(false); | ||
userResult = await Task.Run(() => tenant.GraphService.Users.Request().Filter(filter).GetAsync()).ConfigureAwait(false); | ||
} | ||
catch (Exception ex) | ||
{ | ||
ClaimsProviderLogging.LogException(ProviderInternalName, $"on tenant '{tenant.Name}' while running query '{filter}'", TraceCategory.Lookup, ex); | ||
return claims; | ||
} | ||
|
||
User user = userResult.FirstOrDefault(); | ||
if (user == null) | ||
{ | ||
// If user was not found, he might be a Guest user. Query to check this: /users?$filter=userType eq 'Guest' and mail eq '[email protected]'&$select=userPrincipalName, Id | ||
|
@@ -1464,7 +1474,7 @@ protected virtual async Task<AzureADResult> QueryAzureADTenantAsync(OperationCon | |
// Use await Task.WhenAll() as it does not block other threads, so all AAD tenants are actually queried in parallel. | ||
// More info: https://stackoverflow.com/questions/12337671/using-async-await-for-multiple-tasks | ||
await Task.WhenAll(new Task[1] { batchQueryTask }).ConfigureAwait(false); | ||
ClaimsProviderLogging.LogDebug($"Waiting on Task.WaitAll for {tenant.Name} finished"); | ||
ClaimsProviderLogging.LogDebug($"Waiting on Task.WaitAll for {tenant.Name} finished"); | ||
} | ||
} | ||
catch (OperationCanceledException) | ||
|
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
Oops, something went wrong.