MSAL or ADAL library for use with Azure AD B2C and Xamarin

Jeremy Ellis picture Jeremy Ellis · Oct 14, 2016 · Viewed 10.1k times · Source

As of October 2016, is it still the case that the Microsoft Authentication Library (MSAL - NuGet package: Microsoft.Identity.Client) is the correct/only library to use with Xamarin (iOS/Android) and the Azure AD B2C service? This library (MSAL) is only available as an alpha and does not appear to be in a state of being actively maintained or developed (since April).

There are indications that the Active Directory Authentication Library (ADAL - NuGet package: Microsoft.IdentityModel.Clients.ActiveDirectory) is intended as Microsoft's "one-Azure-authentication-library-to-rule-them-all", and it supports Xamarin; it is also being actively maintained and is not in "alpha" or "beta" status.

Understanding that Microsoft has in the past pointed Azure AD B2C developers towards using the MSAL library, is it possible to authenticate Azure AD B2C users in a Xamarin app using the ADAL library instead? Are there blogs or sample code that someone could point me to, that would demonstrate how to do this?

Answer

vibronet picture vibronet · Oct 15, 2016

It is not possible. As you say, ADAL is generally available and supported - however, it is designed to only work against Azure AD "classic" (e.g. - NOT B2C) and ADFS "3.0" onward. There are important protocol and feature differences that make the ADAL OM and protocol capabilities incompatible with B2C. MSAL represents the new generation of Microsoft's authentication libraries, designed to work with Azure AD v2 endpoints, Microsoft Accounts (MSA) and Azure AD B2C. It is still in preview, but it is under active development - if you observe its repo at https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/, you'll see various branches being worked on. If you want to experiment with B2C and Xamarin, that's the library to use. At this time we cannot share an ETA for when it will be generally available. thanks V.