WCF: Verbose PII Tracing

WCF PII Verbose tracing ==== Depending on app built, update the machine.config file Add line: <machineSettings enableLoggingKnownPii=”true”/> <!– Sample –> <system.serviceModel> <machineSettings enableLoggingKnownPii=”true”/> OUTSIDE <System.ServiceModel> tag add below lines: <system.diagnostics> <sources> <source logKnownPii=”true” name=”System.ServiceModel.MessageLogging” switchValue=”Verbose,ActivityTracing”> <listeners> <add type=”System.Diagnostics.DefaultTraceListener” name=”Default”> <filter type=”” /> </add> <add name=”ServiceModelMessageLoggingListener”> <filter type=”” /> </add> </listeners> </source> <source propagateActivity=”true” name=”System.ServiceModel” switchValue=”Verbose,ActivityTracing”>…

0

Difficulties reading PSObject using WCF Message class

Issue: We would not be able to deserialize powershell object (PSObject) using WCF Message class directly. Error: “The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://schemas.xyz.com/Services/MyService:DoServiceResult. The InnerException message was ‘Member ‘CliXml’ was not found.’.”.   • Cause – Failing Message: <CliXml i:type=”d3p1:string”…

0

AppFabric: Caching service crashed with exception {System.ArgumentException: An entry with the same key already exists.

Recently we had some cases where AppFabric caching service was crashing with error “An entry with the same key already exists.” Issue: In the AppFabric event logs (Applications and Services Logs > Microsoft > Windows > Application Server-System Services), we’ll see below error logged. AppFabric Caching service crashed with exception {System.ArgumentException: An entry with the…

0

WCF: Windows authentication and streaming support

Issue: We had a requirement to use STREAMING protocol along with WINDOWS AUTHENTICATION. Out of the box configuration:                 Above binding configuration will not help us here and we will end up seeing below error. Error Message: $exception {“HTTP request streaming cannot be used in conjunction with HTTP…

0

WIF: Fetch SAML tokens from IssuedToken* endpoint for backend service call

Recently, I have across a scenario where the requirement is to fetch token from “IssuedToken*” active ADFS endpoints. Once application has the token from “IssuedToken*” endpoint, it would have to present the token to backend WCF service application operation invokes. We went through a lot of hardship to figure out the right binding and ADFS…


WS/WCF: Remove Server Header

Requirement: Need to suppress all instances of the HTTP ‘Server’ header from all HTTP responses including invalid requests that never even reach the application process. Why we need this: Exposing Server headers as part of response payload is security vulnerability documented under https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html section 14.38. Workaround for Self Host WCF Services: Set below registry flag…

0

WIF: Active authentication against “usernamemixed” ADFS endpoint

Scenario One of my customers recently wanted to help write code/ configuration in the following scenario. ASP.NET web application and WCF service would be hosted on two different machines (IIS web server). User would access web application. And, it would make an “active authentication” call to “usernamemixed” ADFS endpoint. Once it has the token from…


Recovering COM+ Applications from a hang state

Recently, I worked with some customer problems where they encountered issues with COM+ application going into a hang state. This causes sometimes the main applications to wait indefinitely without recovering from the problem. In such circumstances, many users/developers of the com+ application manually check the state of the com+ application in the component services page…


AF: AppFabric Invalid Version Error

On a clustered environment when you try to start the AppFabric caching service you may encounter the error AppFabric Invalid Version Error. You will see the following exception logged in the AppFabric event logs AppFabric Caching service crashed with exception {Microsoft.ApplicationServer.Caching.DataCacheException: ErrorCode<ERRService0001>:SubStatus<ES0001>:Service initialization failed. No user action required. —> Microsoft.Fabric.Common.OperationCompletedException: Operation completed with an exception…


CryptoConfig is not able to identify HashPbkdf2 from the machine.config file, which is set as: <cryptoClass PKDF2Hashing="HashPbkdf2,…

To know more about CryptoConfig please refer to https://msdn.microsoft.com/en-us/library/system.security.cryptography.cryptoconfig(v=vs.110).aspx It’s a class that accesses the cryptography configuration information. Please refer to https://blogs.msdn.microsoft.com/shawnfa/2008/12/02/cryptoconfig/ to know more on CryptoConfig. Recently I encountered an issue where a customer was implementing his own HashPbkdf2 class that does the SHA256 hashing based on Password-Based Key Derivation Function 2. A theoritical…

0