Securing your OData service is essential to prevent unauthorized access. In this guide, we’ll explore how to implement Username & Password Authentication in Mendix for OData.
IMPORTANT :-
Setup your security first in both the application, for this tutorial i have two user roles.
- Administrator
- User
Open your first application from where you published OData services.
Open your POS_Customer (Your Published OData Service) → Go to the Settings tab, check the box for Username and Password, and in the Allowed Roles section, select User (You can choose any role based on your requirement, but for this tutorial, I am selecting User).

Now Copy your Username & Password from App Security -> Demo Users.
Make sure you have configured your security successfully.
Here, I copied the credentials for demo_user because I selected User as the user role. If you select a different user role, please copy the Username & Password for that specific user.

Now Open your second application from where you Consumed OData services.
Open your COS_Customer (Your Consumed OData Service) -> Check the box for Use HTTP Authentication & Paste the Username and Password that you copied from Published OData Services application.

Now run the application & test it.

Conclusion:
I hope this article has helped you understand How to Implement Username & Password Authentication in Mendix OData.
Thanks for reading this! See you in the next blog post.