forcedotcom / code-builder-feedback

This repository is used to collect feedback for the Code Builder beta.
29 stars 2 forks source link

Port Forwarded Link Gives 403 Error #241

Closed liumiaowilson closed 7 months ago

liumiaowilson commented 7 months ago

Describe the bug When we run a node js service in CodeBuilder and forward its port, there is 403 error when we visit the generated link.

To Reproduce Steps to reproduce the behavior:

  1. Start node js server by running http-server. The default port is 8080.
  2. Add forward port for 8080
  3. Go to the generated link https://xxx.sf.code-builder.platform.salesforce.com/proxy/8080/
  4. See error 403

Expected behavior We should be able to see the served pages from locally running services.

Screenshots

Screen Shot 2024-02-04 at 4 56 04 pm

Desktop (please complete the following information):

jfryman commented 7 months ago

This is actually working as designed.

Salesforce submitted an upstream patch to explicitly disable the internal proxy as part of our security audits, and we enable this flag on all of our Code Builder instances (upstream patch: https://github.com/coder/code-server/pull/6349).

This is a result of some of our internal security audits where we choose to disable this feature. I'm sure our product team would like to know if there is a continuing use-case for this so we can work with it, but for now it is disabled on the internal server. This is to ensure that users always use the internal authentication mechanisms we've setup and cannot provide a bypass. (See feature explanation here: https://github.com/coder/code-server/issues/6348).

What should work however is this:

https://xxx--8080.sf.code-builder.platform.salesforce.com

This will ensure that the HTTP calls flow through the Salesforce authentication, and should also land at the forwarded port in the same way.

Would you please try this out and confirm that things are working as expected this way? Thanks!

liumiaowilson commented 7 months ago

Thank you very much @jfryman This really works. https://xxx--8080.sf.code-builder.platform.salesforce.com

StephenLLLLL commented 6 months ago

Hello @liumiaowilson , this issue has been addressed. Now, when you add a new port (e.g., 8080), the forwarded address will be in the correct format: https://xxx--8080.sf.code-builder.platform.salesforce.com