Extended API Authentication
On this page we will explain how to integrate the authentication code for a dynamic insertion of the user information which is needed to retrieve the authentication token (Bearer-Token). For that we simply must extend our Controller with an expected body as well as give such body in the corresponding http-Call. Yet, how you will incorporate the retrieval process of the user information is all up to you, you can make with a simple login page/pop-up, or you can retrieve the information from your own company-account if it is saved there. In the example, we will make a simple variable that holds the information as an example.
In case you want to make your dynamic code accessible for a guest user who doesn’t have a login information, you can simply make an IF() statement in which you check if the user has sent an attribute in which he states that he is a guest, then you can simply request the token with a hard-coded user-information.
So that we can accept a body in the http-get-call, we need to create a model class for the body. Within the model class we will have 3 attributes.
- IsGuest
- Username
- Password
We will also make the IsGuest required so that we can always determine if the user is a guest or not.
ClientInformation Model

Extended Controller
Now that we have created the Model class for the expected body, we can extend the Controller.
Controller extended version