Building a client application connected to the authentication service
Once we have an authentication service, building a simple login form is straightforward. We can use the standard HttpClient
class to send HTTP requests and receive responses.
We will create a simple login form with two editors and a Log In button that sends an email and password to the server. To maintain a structured code base, we will place all communication logic into a separate WebService
class. The view model will act as an intermediary between the view and the service:
Figure 5.11 – Basic app with a login form
Note that when your service is hosted on your local machine, external devices cannot access it unless you create a tunnel. In this and other recipes, we will use the dev tunnel configured in the previous recipe in the There’s more… section. This allows you to test your application from emulators and real devices even if they are not connected to your...