Follow the below steps:
- create an anonymous user role in tour application and a create login page for that
- create a capture credentials entity and add attributes like login id and password and on the load of the login page on a data view assign data source as microflow and create an above-mentioned entity and add to text inputs in it.
- add a button to login( the button may be a singing button that comes with the inbuilt widgets of Mendix or else call a microflow and with the help of a java action (you have to create using core API of Mendix) you can make the user login to the app.
Note: Role-based access should be maintained.
Link for core API:
https://apidocs.rnd.mendix.com/4/runtime/classcom_1_1mendix_1_1core_1_1_core.html
Click on the above link and search for login and from there you can understand what you can do.