diff --git a/Yvand.EntraCP/Yvand.EntraClaimsProvider/EntraIDEntityProvider.cs b/Yvand.EntraCP/Yvand.EntraClaimsProvider/EntraIDEntityProvider.cs index 11b8c79..e863bb5 100644 --- a/Yvand.EntraCP/Yvand.EntraClaimsProvider/EntraIDEntityProvider.cs +++ b/Yvand.EntraCP/Yvand.EntraClaimsProvider/EntraIDEntityProvider.cs @@ -15,6 +15,7 @@ using System.Linq; using System.Net; using System.Reflection; +using System.Threading; using System.Threading.Tasks; using Yvand.EntraClaimsProvider.Configuration; @@ -103,6 +104,10 @@ public async override Task> GetEntityGroupsAsync(OperationContext c } } } + catch (TaskCanceledException ex) + { + Logger.LogException(ClaimsProviderName, $"while getting groups for user '{currentContext.IncomingEntity.Value}' from tenant '{tenant.Name}': The task likely exceeded the timeout of {currentContext.Settings.Timeout} ms and was canceled", TraceCategory.Augmentation, ex); + } catch (Exception ex) { Logger.LogException(ClaimsProviderName, $"while getting groups for user '{currentContext.IncomingEntity.Value}' from tenant '{tenant.Name}'", TraceCategory.Augmentation, ex); @@ -550,7 +555,7 @@ protected virtual async Task> QueryEntraIDTenantAsync(Oper } catch (OperationCanceledException) { - Logger.Log($"[{ClaimsProviderName}] Queries on Microsoft Entra ID tenant '{tenant.Name}' exceeded timeout of {timeout} ms and were cancelled.", TraceSeverity.Unexpected, EventSeverity.Error, TraceCategory.Lookup); + Logger.Log($"[{ClaimsProviderName}] Operation on Entra ID for tenant '{tenant.Name}' exceeded the timeout of {timeout} ms and was cancelled.", TraceSeverity.Unexpected, EventSeverity.Error, TraceCategory.Lookup); } catch (AuthenticationFailedException ex) {