public static void ValidateDigestCredential(NetworkCredential credential, TokenImpersonationLevel impersonationLevel) { if (!SecurityUtils.NetworkCredentialHelper.IsDefault(credential)) { // With a non-default credential, Digest will not honor a client impersonation constraint of // TokenImpersonationLevel.Identification. if (!TokenImpersonationLevelHelper.IsGreaterOrEqual(impersonationLevel, TokenImpersonationLevel.Impersonation)) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format( SR.DigestExplicitCredsImpersonationLevel, impersonationLevel))); } } }
public static void ValidateDigestCredential(ref NetworkCredential credential, TokenImpersonationLevel impersonationLevel) { if (!System.ServiceModel.Security.SecurityUtils.IsDefaultNetworkCredential(credential) && !TokenImpersonationLevelHelper.IsGreaterOrEqual(impersonationLevel, TokenImpersonationLevel.Impersonation)) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(System.ServiceModel.SR.GetString("DigestExplicitCredsImpersonationLevel", new object[] { impersonationLevel }))); } }