none
MSAL and MobileServiceClient

    Question

  • Can MSAL be used with MobileServiceClient. Specifcally can a token created using MSAL from Azure B2C be passed to MobileServiceClient.  here is example code //get token from MSAL
    PublicClientApplication pca = null;
    pca = new PublicClientApplication(clientId)
    Microsoft.Identity.Client.AuthenticationResult result =await pca.AcquireTokenAsync(new string[] { clientId },string.Empty, UiOptions.ForceLogin, null, null, authority,signInPolicy);
    //Set token to MobileService
    App.MobileService.CurrentUser = new MobileServiceUser(result.User.UniqueId);
    App.MobileService.CurrentUser.MobileServiceAuthenticationToken = result.Token;
    Thursday, April 6, 2017 2:43 AM

All replies

  • Refer to - https://developer.xamarin.com/guides/xamarin-forms/cloud-services/authentication/azure-ad-b2c/

    Disclaimer: This response contains a reference to a third party World Wide Web site.
    Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there.
    There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieing any software from the Internet.

    Thursday, April 6, 2017 5:23 PM
    Moderator
  • I have a similar question.

    How can I make MSAL work with MobileServiceClient for users using Microsoft accounts?

    All examples I've seen are for Azure AD, and whenever I try to change pieces of the code for what I think should work for MSA--it doesn't work.

    What should be passed to AcquireTokenAsync to make it work? Scopes? Authority?

    Sunday, August 6, 2017 9:41 PM
  • Refer to Bruce Chen's post in the StackOverflow link - https://stackoverflow.com/questions/43462995/msal-azure-mobileservice-and-auto-rest-calls-get-401-unauthorized

    -----------------------------------------------------------------------------------------------------------------------------------
    Do click on "Mark as Answer" on the post that helps you and vote it as helpful, this can be beneficial to other community members.

    Tuesday, August 8, 2017 7:31 AM
    Moderator