Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port Forwarded Link Gives 403 Error #241

Closed
liumiaowilson opened this issue Feb 4, 2024 · 3 comments
Closed

Port Forwarded Link Gives 403 Error #241

liumiaowilson opened this issue Feb 4, 2024 · 3 comments

Comments

@liumiaowilson
Copy link

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):

  • OS: MacOS
  • Browser: Chrome
  • Version: 121
@jfryman
Copy link

jfryman commented Feb 5, 2024

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: coder/code-server#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: coder/code-server#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!

@jfryman jfryman closed this as completed Feb 5, 2024
@jfryman jfryman reopened this Feb 5, 2024
@liumiaowilson
Copy link
Author

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

@StephenLLLLL
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants