NOTICE: Significant community changes coming soon
The header menu and the home page on our community will be changing soon. Get more information HERE.
New Member.

Scripting problem with federated security logon (ADFS) and encrypted/encoded WCF calls




I am trying to record and replay a WPF application using WCF calls in VuGen version 11.52.

The application is using a federated security model implemented via Microsoft ADFS.

After logon the WCF communication is encrypted via server certificates (message based security) and is encoded with MTOM.

My VuGen scripting problem can be divided into 2 sub problems.

-   Logon

-   Encrypted data communication.



I have the following code from the developers. They are setting a few properties in the c# .net code like this:

var adfsBinding = new WS2007FederationHttpBinding(WSFederationHttpSecurityMode.TransportWithMessageCredential);

adfsBinding.Security.Message.EstablishSecurityContext = false;

adfsBinding.Security.Message.IssuedKeyType = SecurityKeyType.BearerKey;


var channelFactory = new WSTrustChannelFactory(adfsBinding, _resourceProviderEndpointAdress);

channelFactory.TrustVersion = TrustVersion.WSTrust13;

channelFactory.Credentials.SupportInteractive = false;

channelFactory.Credentials.UseIdentityConfiguration = true;

return channelFactory;



var requestSecurityToken = new RequestSecurityToken(RequestTypes.Issue, KeyTypes.Bearer);

requestSecurityToken.AppliesTo = _relyingPartyIdentifier;

return requestSecurityToken;


My problem is that the second server request in my script has a DigestValue and a SignedValue that I can’t correlate.




It seems like the request is signed by the client, but the developer doesn’t know exactly what happens internally in the WCF framework.


Have any of you out there tried to script something like the above, and did you succeed scripting it?


In VuGen in “Manage Services” under the “Protocol and Security” tab I can set a lot of different settings regarding security. I can for example see that one of the options is “WCF – WSFederationHTTPBinding”, but I really don’t know how to set the options. I have tried to read the chapter about “Web Services – Security” in the user’s guide to LoadRunner but it mostly states the possible options for each field, and not how to figure out how you should set the options.


Is there a guide to setting these options?


Encrypted data communication


When logon is done I can’t see the real content of the “data communication”, because it is encrypted. I can see the XML tag names, but all data is encrypted with a server certificate and then encoded via MTOM. Can VuGen help me decrypting and decoding this kind of WCF request?


I have looked at the Data Format Extention, but again I can’t figure out how to set the options.


A part of the WCF request looks like this:

...<e:EncryptedData Id=\"_3\" Type=\"\" xmlns:e=\"\"><e:EncryptionMethod "

                      "Algorithm=\"\"/><KeyInfo xmlns=\"\"><o:SecurityTokenReference xmlns:o=\"\"><o:Reference ValueType=\"\" URI=\"#_1\"/></o:SecurityTokenReference></KeyInfo><e:CipherData><e:CipherValue>iwiv5D98GhyQQ9vu25ts3h3zEGGsU0cfqIenkI4LUup0Xc5MxrDLehtPP4mv2ybT8x41qt+qx3+"

                      "BcV4ks4Lgm26J0LkhUa0bYIyVPFqjY1hVYJGmucBtMqmpLA4beMw4C76Sr7NNQD4sXIgEaU3Tsg==</e:CipherValue></e:CipherData></e:EncryptedData></s:Body></s:Envelope>\r\n--uuid:ef636835-787a-473a-ab4b-c7b03e28bc21+id=75\r\nContent-ID: <>\r\nContent-Transfer-Encoding: binary\r\nContent-Type: application/octet-stream\r\n\r\n\\xD8\\xEE\\xD6x\\xFC\\xA3y\\xBD\\x9Dm^\\xF6vq8\\x95\\xD7\\x08\\xA5\\xBF\\x84\\x80\\xF0&!q!f9\\xB5\\xC5]\\xAD=\\xE1\\xC4;~\\x198q="


                      "RO\\xEE\\xEEI\\xB4\\xAA\\x02\\xD0u\\x7F\\xDA\\xD2\\xB70\\x1B\\xE6\\xC2\\x85\\x92q\\xB2\\x96SF/F\\x02\\xDE\\xBF\\x05\\x84\\xD3SO\\xB4\\xDD(\\xC3WS\\xEC\\x17\\xF4\\x93\\x11\\xE1q-\\xA1\\xDF\r\\x06\\xD1~\\x9Dct\\x06$\"\\xE2\\xC2V(\\xBC\\xAA\\x1E\\xC5\\xAEL\\xCB<&\\xE3\\xAB36\"\\xC7K\\\\\\x04\\x16\\x0BN\\xB4\\x05\\xB0\\xFBl\\xE4\\x82g_6;\\xE8\\xBC\\xDDAL!\\xC6y\\xD3\\xE2\\xBDl\\xAEL\\xBEk\\x19\\x0C\\xD2g;.\\xA8o\\xB1e\\xFA\\x10Z7\\x0C \\xFF\\x11\\x8A\\xA3o\\xD4\\xAD,\\x06\\x92VR\\x1D\\x84l\\xE9~"




So if you are skilled in handling this kind of requests I would like to hear from you.

If you know where to find documentation on how to script these issues I would also like to hear from you.

Thank you in advance.

Kind regards

Per Thyssen



0 Replies
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.