rwtombaugh/azure-mobile-services — pull request #1 by tjanczuk (2012-10-09 04:46:36+00:00)
Title: Multi-auth login support

@rwtombaugh @joshtwist

This is a first cut of the multi-auth login support for MobileClient. I don't intend for this to be taken as-is, but wanted to start CR early.

It supports `loginViewControllerWithProvider` and `loginWithProvider` (server and client flow, respectively). The piece that is missing is adjusting the UI of the view controller to allow for its configuration by the developer (plus more usable defaults). I thought I would send this out to gather feedback.

This is the experience for server flow:

```
__block MSClientLoginSuccessBlock onSuccess = ^(MSUser *user) {
[self dismissViewControllerAnimated:YES completion:nil];
};

__block MSErrorBlock onError = ^(NSError* error) {
[self dismissViewControllerAnimated:YES completion:nil];
};

__block MSNavigationCancelled onCancel = ^{
[self dismissViewControllerAnimated:YES completion:nil];
};

MSClient *client = [MSClient clientWithApplicationURL:[NSURL URLWithString:@"https://carlos1004.zumotcantbay.antares-test.windows-int.net/"]];
id lvc = [client loginViewControllerWithProvider:@"facebook" onSuccess:onSuccess onCancel:onCancel onError:onError];
[self presentViewController:lvc animated:YES completion:nil];
```

And this is the experience for client flow:

```
__block MSClientLoginSuccessBlock onSuccess = ^(MSUser *user) {
// ...
};

__block MSErrorBlock onError = ^(NSError* error) {
// ...
};

MSClient *client = [MSClient clientWithApplicationURL:[NSURL URLWithString:@"https://carlos1004.zumotcantbay.antares-test.windows-int.net/"]];
[client loginWithProvider:@"facebook" withToken:@{@"authenticationToken": @"abc"} onSuccess:onSuccess onError:onError];
```

Waiting for comments.