Xamarin.Essentials' WebAuthenticator vs MSAL?

435 Views Asked by At

Being a newbie to Xamarin I am not sure if these can be compared.

I am looking at ways to authenticate a user through Xamarin app.

We use Azure AD and my Xamarin app wants to autheticate the staff of our organization. It then needs to access an Azure AD authenticated API.

The 2 options I found:

  1. Xamarin.Essenials' WebAuthenticator, looks like a good option. But I feel like it is for a B2C applications(because it mentions about social authentication).

    The site mentions this is more secure as there is a middle layer to do the authentication. But when I checked the source code for middle layer(Startup.cs) there were Clientid and client secrets.

    https://devblogs.microsoft.com/xamarin/authentication-xamarin-essentials-aspnet/?WT.mc_id=DT-MVP-5003277

  2. I also read about MSAL for authenticating users. It is a nuget (and so is the above one) and just takes ClientId(and not the client secret).

    https://learn.microsoft.com/en-us/azure/active-directory/develop/msal-overview

So I am wondering which would be best in my case: WebAuthenticator or MSAL?

Which is more secure,if it can be compared?

Is there any disadvantage of using either?

Is there a better way to do authentication securely?

Thanks in advance.

0

There are 0 best solutions below