Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configuring authentication for webpack proxy

I have a .Net Web API service running with windows authentication enabled. I've a separate UI application for which webpack is setup. I'm trying to setup webpack proxy to access my service. Here is my current configuration

 "proxy": {
      "/api/*": {
      "target": "http://localhost:50643",
    }
  } 

I'm getting a 401 (Unauthorized) error now. How do I setup webpack proxy to enable authentication.

like image 448
sree Avatar asked Nov 30 '16 02:11

sree


1 Answers

You can provide auth prop: "proxy": { "/api/*": { "target": "http://localhost:50643", "auth": "username:password" } }

like image 126
anton_byrna Avatar answered Oct 15 '22 17:10

anton_byrna