Mattermost login page

Hi,

Could it be possible to replace the Mattermost login page so that we could evaluate if we allow access or not to a user depending on the source ip or source country and of course the own password, but being able to allow or deny login depending (just for the time user and pass are checked) on several factors, like time and some more other things among the own password?.

Best regards,

Can we for instance allow login (referring to login as the check user pass moment) and doing it in background (though the Mattermost api) if the password is correct and the conditions that moment are valid for allowing to be checked the user and password (and granted if the conditions are met and the password is correct)?. If all that happened can we obtain the auth token and give that token to Mattermost desktop and ios/android apps so that they could be able to work with Mattermost the same way as if they would have used the official default Mattermost login page (the same one where an admin user can login I meant).

For all this, I’m not referring to the stage where you are logged and you keep logged perhaps 30 days. I’m referring to just the moment where you login (moment at which Mattermost checks user and pass) before obtaining the token which with you later validate let’s say 30 days for instance…

Basically I would love to replace Mattermost login page for a custom one, later do all the checks I need and if all is correct, authenticate with user and password through the Mattermost api and then provide that token to client apps for being able them to work the same way as they would work if had been logged in with the default Mattermost login page.

Is that possible?.