Authentication with Username and Password in Xamarin.Android and Xamarin.IOS using .NET Standard

I'm developing a new app using Classic Xamarin (Xamarin.Android and Xamarin.IOS) that has a .NET Standard 2.0 project for shared code and implements MVVMCross. I need to allow my mobile users to authenticate with username and password against a WCF web service. The web service offers a LoginRequest method that takes username and password and sends pack a LoginResponse with a Session ID.

I found the WCF Walkthrough to be helpful in setting up by WCF connected service inside my .NET Standard project within the solution. However, the code samples for this walkthrough are a bit weak in terms of what needs to be done to permit authentication with username and password. My ultimate goal is to simply call the LoginRequest from either my Android or iOS project, trap the LoginResponse and allow the user to view the HomeView if response is favorable.

Do my login request and responses need to be housed in the .NET Standard project as an interface to the WCF Service? If so, can someone direct me to some code samples in terms of how to implement this with my use case?

How do I "trap" the LoginResponse and alert the respective view to navigate the user to the Home screen?

Greatly appreciate a nudge in the proper direction. Thanks!!

Sign In or Register to comment.