Question

I have an azure mobile service with a c# backend. I'm trying to login with a microsoftaccount inside of my xamarin application. Here i'm calling the login method. I do get a pop up to fill in my information but then it wants to open a second pop up and then i get the exception that the request could not be completed:

Microsoft.WindowsAzure.MobileServices.MobileServiceInvalidOperationException: The request could not be completed.

private async Task Authenticate(UIViewController view) { try { user = await client.LoginAsync(view,MobileServiceAuthenticationProvider.MicrosoftAccount); } catch (Exception ex) { //something went wrong }

When i used a javascript backend this code worked perfectly but now it somehow does not work anymore. Do i need to add something in the c# backend??

Was it helpful?

Solution

The configuration of the authentication is slightly different. First, the redirect URI should be of the following form:

https://.azure-mobile.net/signin-microsoft

Also, (assuming you are configuring the service through the My Applications page in the Live Connect Developer Center) the settings that I have are as follows:

  • Mobile or desktop client app: yes
  • Restrict JWT issuing: yes
  • Enhanced redirection security: yes

Henrik

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top