I am attempting to setup an oath2 proxy using vertx to protect a legacy web application. However, I can’t seem to get the callback right after authentication. Can anyone help me understand what the routing rules should be?
Some how need to protect the app on port 8200, using the proxy on 8201 but need a callback that doesn’t get stuck in a loop.
v = Vertx.vertx();
HttpClient proxyClient = v.createHttpClient();
HttpProxy httpProxy = HttpProxy.reverseProxy(proxyClient);
Router proxyRouter = Router.router(v);
HttpServer proxyServer = v.createHttpServer();
OAuth2Auth authProvider = AzureADAuth.create(v, "CLIENT_ID", "CLIENT_SECRET", "TENANT_ID");
oauth2.setupCallback(proxyRouter.route("/callback"));
proxyRouter.route("/*").handler(oauth2);
proxyRouter.route(HttpMethod.GET, "/*").handler(ProxyHandler.create(httpProxy, 8200, "localhost"));
proxyServer.requestHandler(proxyRouter).listen(8201);