0

Scenario

  1. I have nodejs app is deployed on our infrastructure at work
  2. At some point in the login / auth process of my app, my app will make a POST request to https://login.microsoftonline.com for authenticating the user (remix-auth-microsoft library is the one making the POST request)
  3. My POST request to login.microsoft.com fail because our servers at work are not allowed to make external calls to the internet, unless we make our requests through a proxy (lets call it: example-proxy.com)

Question

  1. How would I intercept the HTTP POST call that the 3rd party library is making in my nodejs app and proxy that request to example.proxy.com. Essentially I want login.microsoft.com to think the POST request is coming from example-proxy.com. Then I want the proxy server to return that data to my app

  2. Are there specific headers I need to pass to make this work?

Some pseudo code of what I'm trying to do:

someInterceptor.on(request, (request) => {
  if(outgoingRequest === 'https://login.microsoftonline.com') {
    // somehow re-write the request so login.microsoftonline.com thinks the POST is coming from example-proxy.com
  }
})
Clifford Fajardo
  • 1,357
  • 1
  • 17
  • 28

0 Answers0