How to add custom login behaviour

I need to add a custom login page which should validate the user credentials by connecting to external database. I referred below question and looks  same as my requirement. I implemented below steps Create a custom login page with below authentication widgets              I have a microflow that calls a rest service to validate the credentails   I have below issues How to invoke a microflow when user clicks on sign-in button. There is no way to configure a microflow on this widget. How to get Login id text box and Password text box values in microflow.   I am not sure whether I am using right widgets or not. If not should I use plain text box and button widgets for my requirement instead of authentication widgets. Also want to know is there a better mechanism to implement this. Note: I don't want to validate mendix credentails
1 answers

No matter what you do, ultimately a User record needs to be created in your Mendix app. However, this functionality is quite extensible.

In fact, there are a number of modules in the app store that offer connectivity to standard SSO protocols like LDAP and SAML. You can also build a custom solution: Here is a great blog post describing how to perform custom logic when a user tries to log in:

So, use something like this, and when your custom microflow is called, look up the user in the external system and validate their credentials. If the authentication is successful, create/update the User record, and ensure it has the right user roles. Then pass that user out of the microflow and they will be logged in. If the authentication fails, pass back an empty user object and let the auth fail.

As for the UI, you can either use the default login page or the custom login widgets as you discussed above.