azure-dev icon indicating copy to clipboard operation
azure-dev copied to clipboard

[codespaces] Web app does not follow redirects from "private" port

Open danieljurek opened this issue 3 years ago • 0 comments
trafficstars

When hosting an API and Web app in codespaces the API URL must be made "Public" ... This is (partially) because the react app does not follow redirects when running in the client's browser.

Repro steps:

  1. Create codespaces instance against a sample repo (example)
  2. Provision resources
  3. Launch debug for the API
  4. Manually mark the port as "Private" (warning the "Ports" page may not reflect the accurate state of the port, use gh codespace ports -c $CODESPACE_NAME instead) using the gh codespace ports visibility 3100:private -c $CODESPACE_NAME
  5. Start the web app (debug not required)
  6. Launch the debug app

Expected: Page content loads properly Actual: Page content does not load

The request to get lists is redirected to an authentication experience:

image

Setting the port to public instead of private alleviates the problem.

In its current state, using codespaces with public ports is not significantly different from deploying the application itself using azd deploy. That is, deploying the application exposes swagger and API endpoints publicly, which is similar to using codespaces with a public API endpoint enabled.

danieljurek avatar Oct 19 '22 14:10 danieljurek