From 73cc9c1519fe77e37a774d1902a10329e0089bc9 Mon Sep 17 00:00:00 2001 From: Neos Santos Date: Thu, 23 Mar 2023 00:15:19 +0000 Subject: [PATCH] avoid update email when trying to remove --- .../Protocol/ProtocolExtensions.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Microsoft.SystemForCrossDomainIdentityManagement/Protocol/ProtocolExtensions.cs b/Microsoft.SystemForCrossDomainIdentityManagement/Protocol/ProtocolExtensions.cs index 282cca9b..bbb1c2b2 100644 --- a/Microsoft.SystemForCrossDomainIdentityManagement/Protocol/ProtocolExtensions.cs +++ b/Microsoft.SystemForCrossDomainIdentityManagement/Protocol/ProtocolExtensions.cs @@ -891,7 +891,7 @@ public static Uri GetResourceIdentifier(this Resource resource, Uri baseResource string escapedIdentifier = Uri.EscapeDataString(resource.Identifier); string resultValue = typeResource.ToString() + - ServiceConstants.SeparatorSegments + + ServiceConstants.SeparatorSegments + escapedIdentifier; result = new Uri(resultValue); return result; @@ -1061,10 +1061,12 @@ internal static IEnumerable PatchElectronicMailAddresses( ( value != null && OperationName.Remove == operation.Name - && string.Equals(value, electronicMailAddress.Value, StringComparison.OrdinalIgnoreCase) ) { - value = null; + if (string.Equals(value, electronicMailAddress.Value, StringComparison.OrdinalIgnoreCase)) + value = null; + else // when the value not match, should skip remove anything, return the original emails + return electronicMailAddresses; } electronicMailAddress.Value = value;