Hello Suraj,
You can create a custom login page inside mendix stidio pro and define the custom login in the way you requires (In microflow with your custom logic and Java actions).
Please refer the below,
Custom login page creation: https://www.youtube.com/watch?v=ePuS-grmcXw
Java action for creating session for a user once the custom logic validated the user account : https://forum.mendix.com/link/questions/99450
Follow this learning path: https://gettingstarted.mendixcloud.com/link/module/183/lecture/1426/3.7.3-Creating-a-Custom-Login-Page
Regards,
Ronald