Logout from Microsoft/Yahoo/Google using WebAuthenticationBroker

WebAuthenticationBroker is one of the handy API that I use to implement login in app using common login services like Microsoft, Google and Yahoo. This ensures that you don’t need to worry about implementing your own login functionalities. So how do you logout from these services when the user logout from your app? It’s quite simple, you only needs to send logout request to respective services.

Here are the logout urls for Microsoft/Yahoo/Google.


and in your code:

WebAuthenticationBroker.AuthenticateAsync(WebAuthenticationOptions.SilentMode, new Uri(logout-url-here));

Hope this helps.

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.

Universal Windows development in Windows 8.1 and Windows 7

The bold concept Windows 10 introduced was Universal Windows Platform (UWP) - "Write once, Deploy anywhere" truly and literally. To make it more simple and clear, if you create Universal Windows application, then you can run the same app in variety of devices ranging from Desktop, Tablet, Mobile and upto your holographic computer (HoloLens) without recompiling your code. Initial requirement for UWP app development was Windows 10 and Visual Studio 2015.

Things have changed now! With the recent announcement at //build/ 2015, you can develop UWP app in Windows 8.1 and Windows 7 operating system using VS2015. But, please note the experience may defer. For example, if you are developing UWP app in Win 8.1/7, then you cannot deploy the app to your Local Machine or to any simulators. Instead, you need a real device for development and testing. The exception is, Mobile emulators will be there. Also, XAML Designer support will not be there, but Intellisense is. For developing UWP in Windows 7, you need to wait till VS2015 hits RTM.

Here is a screenshot of UWP OS support which was share during //build/ 2015 event.

This is a welcome change. There is always a large community who cannot immediately migrate to Windows 10 exclusively for UWP app development. This move will definitely help them and those who are hesitant to update to developer preview of Windows 10.