Miroslav Adamec
Miroslav Adamec

Reputation: 1138

Xamarin forms - windows authentication webapi

Is there a way I can call my WebApi, that uses Windows authentication from Xamarin Forms? Application will be used only on internal network or VPN. With internet access.

Can I use MSAL for this? (https://blog.xamarin.com/authenticate-mobile-apps-using-microsoft-authentication-library/)

AD accounts are synchronized into Azure.

Upvotes: 1

Views: 985

Answers (1)

Daniel Dobalian
Daniel Dobalian

Reputation: 3237

I recommend you use the Azure AD v1.0 endpoint, which means using ADAL rather than MSAL at the moment. The Azure AD v2.0 endpoint (and by extension MSAL) does not yet support getting tokens for your own Web API. Remember, this means you'll need to register your app in the Azure portal rather than the App Registration portal.

Here's a few helpful artifacts:

  1. Here's an awesome code sample of using ADAL .NET to create a Xamarin multi-target sample.
  2. Vittorio Bertocci has also written a comprehensive blog post on using Xamarin Forms with ADAL .NET v3.
  3. A ADAL .NET Web App that calls a Web API. I think this may help make sure you get your app configuration correct.

Upvotes: 1

Related Questions