How to use the WebAuthenticationBroker for oAuth in a Windows Phone Runtime WP8.1 app |
After playing around with WP8.1 for a few days (like everyone else), I decided to dig a bit into development of WP8.1. As oAuth is the common authentication method nowadays for Apps and Websites, I was curios about the implementation of the WebAuthenticationBroker in a WINPRT app. I used it before with Windows 8 for my TweeCoMinder app, but that's a few month back (it didn't make it into the Store yet (another goal, right – porting TweeCoMinder to Universal will be a lot of fun and learning for me ;-)). Before we continue: This is a pretty huge topic. Be prepared that it may take you more than one time to read and understand what is going on. Let's dive into it. Unlike the Windows WebAuthenticationBroker, the Phone version does not use the AuthenticateAsync method. It uses AuthenticateAndContinue instead. This is related to the lifecycle on phone, as it is more likely that an WINPRT app is suspended than on Windows (at least that's the official reason). Preparing our App But we are