I'm in the following situation: I have a nodejs application that uses the azure active folder authentication system through the passport-azure-ad module.
At the moment my reply url, the url that I registered on my portal and that I have set as redirectUrl in my passport strategy configuration, is https://localhost:3000/microsoft/auth. Everything works when I go through the authentication process from the machine that runs the server, but obviously fails from any other device after I sign in with my microsoft account and https://localhost:3000/microsoft/auth gets returned(to be more precise, the authentication goes well but the returned page doesn't load for obvious reasons).
If I change the redirectUrl in my passport strategy(I'm using OIDCStrategy) configuration to where the server is running, e.g. https://machine.that.runs.the.server:3000/microsoft/auth without first registering the url on the azure portal I get an error related to the reply/redirect url mismatching when I try to authenticate.
The reason why I don't want to register https://machine.that.runs.the.server:3000/microsoft/auth on the portal it's because I would like to be able to run the server from any machine and have any other machine connect to it and be correctly redirected after the authentication process, or at least on any machine in my office internal network.
So what I'm asking is if there is a way to either remove the reply/redirect url check or to have some kind of dynamic redirectUrl option where I can set the reply URL in my request. If none of those two can be done I would like to know if there is a way to register a reply URL from the portal that works for all the machines in my network like 10.3.144.x:3000/microsoft/auth.
Thanks in advance.