Tracing in Thinktecture.IdentityModel

A very common question is: “my Web API returns a 401. Why?”

The easiest way to find out, is to enable tracing in IdentityModel. Add the following code snippet to your web.config:


  <trace autoflush=true />



    <source name=Thinktecture.IdentityModel




        <add name=ThinktectureListener />





  <!– worker process account needs write access  –>


    <add name=ThinktectureListener

         type=System.Diagnostics.XmlWriterTraceListener, …



      <filter type=“” />





Detailed authentication errors can now be found in the trace file (using SvcTraceViewer from the SDK), e.g.:



This entry was posted in IdentityModel, WebAPI. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s