I have kind a puzzle-headed task and I don't know where should I start. We have a web app that is in our local net. We want to give access to this app from the outside using Apache.
Basically we want pre-login page on apache that will send user credential using api to our app and receive answer with OTP, which user can write in pre-login page inputbox, send again and in case off success Apache will redirect user to standard apps login page.
Can Apache do that?
Sort of: you can put an authenticating proxy in front of your app that will propagate the established user identity to the backend. See e.g.: https://github.com/OpenIDC/mod_auth_openidc