Looking for an example for Azure Mobile Services developed in Xamarin Forms that is authenticated through Azure AD B2C. I have a working solution where I am able to authenticate using Azure B2C in Xamarin Forms but unable to use the resulting token in Azure Mobile Services. See code snippet below:
public static PublicClientApplication AuthenticationClient { get; private set; }
public static MobileServiceClient MobileService = new MobileServiceClient(Constants.MobileServiceClientName);
result = App.AuthenticationClient.AcquireTokenAsync(
Constants.Scopes,
string.Empty,
UIBehavior.SelectAccount,
string.Empty,
null,
Constants.Authority, null);
JObject objToken = new JObject();
objToken.Add("authenticationToken", result.IdToken);
//I am successfully able to get an Id token for Microsoft, Google and Twitter providers but when I use the token to login to my Azure Mobile Service app, I get a "Not Authorized" error
MobileServiceUser user = await MobileService.LoginAsync(MobileServiceAuthenticationProvider.MicrosoftAccount, objToken);
Any and all ideas are appreciated.