title: Angular - CORS Origin - External Identity Server 4 instance
body: <p>I'm trying to figure out what's the best way for anyone developing an Angular app locally to connect to an externally hosted Identity Server instance without hitting CORS rules that Chrome is spewing out (not Identity Server).</p>
  
  <p>I was thinking we could use a proxy.config and host it with node so that it redirects <strong>localhost:4200/dev/identity</strong> to our hosted Identity Server instance. But it's not that simple, it get's a discovery document and then several redirects.</p>
  
  <p>This is quite a common scenario yet I can't find a thing online, which tells me I'm either doing it wrong or there is a far simpler solution. <strong><em>Can anyone point me in the right direction or have a similar proxy file which hits all the well-known end points!?</em></strong></p>
  
  <p>FYI here would be my proxy.config</p>
  
  <pre><code>{
    "dev/identity": {
      "target": {
        "host": "ids-cloud.com",
        "protocol": "https:",
        "port": 443
      },
      "secure": false,
      "changeOrigin": true,
      "logLevel": "info"
    },
    "/dev/identity/.well-known/openid-configuration": {
      "target": {
        "host": "ids-cloud.com",
        "protocol": "https:",
        "port": 443
      },
      "secure": false,
      "changeOrigin": true,
      "logLevel": "info"
    },
    "*": {
      "target": "http://localhost:5000",
      "secure": false,
      "logLevel": "debug",
      "changeOrigin": true
    }
  }
  </code></pre>
  
  <p>The last * is used for sending calls out to my API.</p>