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;