Search code examples
authenticationazure-mobile-services

MobileServiceClient LoginAsync returns wrong userId


I am using the MobileServiceClient.LoginAsync function to login with a Microsoft- and Facebook account in my Xamarin.Forms app. I came across an issue where the loginAsync returns the wrong userId the second time I login:

Lets say my facebook userId is: facebook:11111 and my Microsoft userId is: microsoft:22222. If I login with facebook first, the correct userId is returned. If I login with Microsoft after that, the following userId is returned: microsoft:11111 (instead of microsoft:22222). The same happens when I first login with the Microsoft account, the second time I log in with facebook, the facebook userId is facebook:22222 instead of facebook:11111. I use the following code to login:

var client = new MobileServiceClient(applicationUrl, applicationKey);
client.LoginAsync(provider);

I have also tried to logout first before logging in but has no effect. Am I missing something or is this a bug in the MobileServiceClient?


Solution

  • Apparently this is a known server bug in Mobile Services with a .NET backend: more info