Xamarin iOS and Android bindings for ADAL (Active Directory Authentication Library)


If you’re diving into building cross platform apps using Xamarin and you need to use Active Directory Authentication Library, you will need to create bindings so you can call the native iOS and Android libraries from C#. Xamarin describes the process of creating bindings libraries in details here (Objective -C) and here (Java). But if that feels like too much work, the AD folks have published sample codes that will get you going:

Sample binding project for Xamarin iOS

Sample bindings for Xamarin Android

I will blog more about getting these things to work later on.

 

 

 

 

 

 

 

Comments (4)

  1. Gustav says:

    Hi.

    Thanks for providing information on this topic! I find it hard to come by.

    I've managed to compile the dll in Xamarin (OSX) and I've added the dll as a reference to my project that will use it. That project is created and maintained inside Visual Studio (with Xamarin). The dll shows up in VisualStudio but when I try to use it (new ADAuthenticationContext()) or trying to access the namespace I can't. Did you manage to get this to work from VisualStudio? Should I be able to access ADAuthenticationContext? Any help you can provide would be greatly appreciated.

    Regards,

    Gustav

  2. Richard says:

    Why are the bindings needed. I asume there is a c# implementation of the library why not just adjust that a bit to fit xamarin?

  3. Mat Velloso says:

    @Richard I don't disagree with you. That's why I wrote this guidance: http://www.matvelloso.com/…/authentication-library-choose showing other ways of dealing with this. The last scenario at the end of the post shows how to use the new o365 libraries to do that so you don't need to do any ADAL binding at all.

    @Gustav: I'm working on a more detailed how to guide on how to get past this issue. Apologies I'm taking a while to do that. Watch this space.