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.
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