0
votes

Here is what I want to do.

I want to have a MVC web application that I can user to administer tables in my SQL server database (windows azure). I want to authenticate with a 3rd party login (google, twitter, facebook etc).

I want to have a mobile application that makes use of windows azure mobile services to access and modify those tables. The mobile app will log in with the same providers as above.

The problem: when I log in with the MVC application I have access to the username and email address.

When I log in with the mobile application I get access to a userId ="google":{ "userId":"Google:my-actual-user-id", "accessToken":"the-actual-access-token" } on the mobile service side but not the email address or username.

So if I want to write a Server side script(azure mobile service) to get data from the tables, what should I use as the unique user identifier?? The MVC application does not have access to the userid the mobile application gets on login, and the mobile application does not have access to the username or email address available via the MVC login(OAuthWebSecurity)

I found this link: http://blogs.msdn.com/b/carlosfigueira/archive/2012/10/25/getting-user-information-on-azure-mobile-services.aspx

But looks like you cannot even get the google email using this…. So still no way to uniquely identify the user!!

Thanks for any help

1

1 Answers

0
votes

It doesnt really answer how to get around the issues highlighted above. I imagine using the same type of authentication in my MVC application would have got around this, but then I would have to have found a way to get the email address for a google account. Then I would have had to consider how to handle other authentication providers which would have brought other issues. I found other issues with windows azure mobile services which meant it just wasnt for me

  • Does not seem to be a way of accessing data from a different database namespace with mobile services
  • I was re-writing business logic in the mobile service that I already had in my MVC application, which I had unit tested, with entity framework etc

It seems simple and straight forward if you follow the examples of mobile services but once you step off that track it becomes very problematic and in my view just not worth it. It is not flexible enough to do anything meaningful.... but that just might be me not using it correctly.

So I am now using web api within my MVC application. Using httpclient in my windows app to contact access this data. It allows me to reuse my business logic, and it is much more flexible. If you feel the assessment of windows azure mobile services (chocolate tea pot) is unfair would love to hear an opposing view.