Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

3. Advanced Programming with Windows Ide... > Troubleshooting and monitoring in WI...

Troubleshooting and monitoring in WIF

Troubleshooting and monitoring in WIF You can easily troubleshoot issues in WIF by enabling tracing. It works similar to WCF tracing. In this recipe, we will discuss the steps to enable WIF tracing and see how the trace information can be viewed using the svctraceviewer.exe tool. How to do it... Follow these steps, to enable WIF tracing: Include the following configuration section in the Web.config file of the RP and the STS. <system.diagnostics> <sources> <source name="Microsoft.IdentityModel" switchValue="Verbose"> <listeners> <add name="xml" type="System.Diagnostics.XmlWriterTraceListener" initializeData="C:\Log\WebSTS.svclog"/> </listeners> </source> </sources> <trace autoflush="true"/> </system.diagnostics> Notice the switchValue attribute is set to Verbose to log the detailed trace information. Initiate a sign-in request and access resources from the RP.Notice that the WebSTS.svclog file will get generated in the C:\Log folder (a similar log file will also get generated under the folder specified in the RP Web.config file, if communication with the RP is successful): Note Make sure that the file path specified exists under the specified drive. Create any necessary folders beforehand and don't expect the tool to create the folder (in our example, the Log folder must exist under the C drive). Open the WebSTS.svclog file using the svctraceviewer.exe tool. The tool will show one or more E2ETraceEvent and any exceptions will get highlighted in red, as shown in the following screenshot: How it works... WIF tracing is a very powerful feature that enables developers of STS and RP to troubleshoot and monitor issues with WIF. Different trace types (such as ChunkedCookieHandler, HashTrace, and so on) are generated for the RP and STS under different circumstances. The MSDN article at http://msdn.microsoft.com/en-us/library/ee517282.aspx provides a detailed description of the trace scenarios for STS and RP, including federation and trust protocols. There's more... In addition to WIF tracing, you can also use Fiddler to inspect HTTP messages and check if the tokens are getting generated appropriately. There is a nice WIF Fiddler Inspection tool available at http://identitymodel.codeplex.com/ that can be used to inspect federation messages.

  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint