A Nerd's False Positive.

Debug WebAuthenticationBroker error message

Undoubtedly, WebAuthenticationBroker is one of the best API in WinRT/UWP API stack. It helps you to do OAuth and OpenID authentication without any extra work. We no longer need to use WebView and track the URL redirection to capture the tokens. Instead you can invoke the code from ViewModel also.

Since, we don't have much control on what happens and we rely on the status and result returned by the broker. Sometimes, things get more annoying when you get an error screen as below; but don't have any idea about what caused the issue for real.

Of course, traditional way is to use Fiddler which needs some setup for sure. Thankfully, there is another option too to tract the cause for error. All those error messages will be logged in your Windows Event Viewer. Below is the steps to do that:

  1. Open Event Viewer (eventvwr.exe).
  2. Navigate to Application and Services\Microsoft\Windows\WebAuth.
  3. Rt-click Operational log, and select Enable Log.

There you go!

Now, run the broker again. You can see all the logs.

Hope this will save your day.