O'Reilly logo

Learning Windows Azure Mobile Services for Windows 8 and Windows Phone 8 by Geoff Webber-Cross

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Authentication in the app

If you've created apps before that need to authenticate a user with OAuth2 in order to use services from providers such as Twitter and Facebook, you'll know that it's not straightforward. It has steps such as launching a web page for the user to log in and collecting credentials from browser redirects. Authentication with Windows Azure Mobile Services couldn't be simpler. The MobileServiceClient class has a LoginAsync method that does everything for us.

Logging in

To log in, we use the MobileServiceClient class instantiated with our app key and service URL that we saw in the previous chapter. We simply call the LoginAsync method with the auth provider type we want to use. It will log us in and return a MobileServiceUser ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required