Unable to authenticate ChatGPT with OpenCode web when it's being reverse proxied #6416

Closed
opened 2026-02-16 18:04:09 -05:00 by yindo · 2 comments
Owner

Originally created by @chriswiggins on GitHub (Jan 15, 2026).

Originally assigned to: @adamdotdevin on GitHub.

Description

If you reverse proxy OpenCode web (in our case, we're running OpenCode insider a coder workspace), then ChatGPT OAuth doesn't work, because the OAuth server callback is started on another port.

I've made the changes necessary (in my local environment) to make this work, however it looks like this may be a bit more difficult given the OAuth client ID likely has its redirect URL locked down to http://localhost:1455/auth/callback

It would be great to get some more info on this, and whether or not there is a potential other flow we can use (device code?) to get this to work in OpenCode web!

Plugins

N/A

OpenCode version

dev branch

Steps to reproduce

Try to send a different redirectUri to the ChatGPT OAuth endpoint and note the following error

Image

Screenshot and/or share link

No response

Operating System

macOS 15.4.1

Terminal

Ghostty

Originally created by @chriswiggins on GitHub (Jan 15, 2026). Originally assigned to: @adamdotdevin on GitHub. ### Description If you reverse proxy OpenCode web (in our case, we're running OpenCode insider a coder workspace), then ChatGPT OAuth doesn't work, because the OAuth server callback is started on another port. I've made the changes necessary (in my local environment) to make this work, however it looks like this may be a bit more difficult given the OAuth client ID likely has its redirect URL locked down to `http://localhost:1455/auth/callback` It would be great to get some more info on this, and whether or not there is a potential other flow we can use (device code?) to get this to work in OpenCode web! ### Plugins N/A ### OpenCode version dev branch ### Steps to reproduce Try to send a different redirectUri to the ChatGPT OAuth endpoint and note the following error <img width="636" height="363" alt="Image" src="https://github.com/user-attachments/assets/1feaf255-8a40-4a88-97c5-aab81079571f" /> ### Screenshot and/or share link _No response_ ### Operating System macOS 15.4.1 ### Terminal Ghostty
yindo added the bugweb labels 2026-02-16 18:04:09 -05:00
yindo closed this issue 2026-02-16 18:04:09 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 15, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #7377: [FEATURE]: Allow custom OAuth redirect URI configuration for MCP servers - Feature request for configurable redirect URIs in OAuth settings
  • #8274: /connect doesnt work for openai when server is remote - Similar OAuth redirect issue when using remote/VPS servers
  • #5766: bug: OAuth uses wrong authorization URL and missing redirectUri config - Comprehensive report of OAuth redirect URI configuration issue with enterprise auth servers
  • #7887: opencode mcp auth fails silently in remote/headless sessions - Related issue with OAuth in remote environments

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 15, 2026): This issue might be a duplicate of existing issues. Please check: - #7377: [FEATURE]: Allow custom OAuth redirect URI configuration for MCP servers - Feature request for configurable redirect URIs in OAuth settings - #8274: /connect doesnt work for openai when server is remote - Similar OAuth redirect issue when using remote/VPS servers - #5766: bug: OAuth uses wrong authorization URL and missing redirectUri config - Comprehensive report of OAuth redirect URI configuration issue with enterprise auth servers - #7887: opencode mcp auth fails silently in remote/headless sessions - Related issue with OAuth in remote environments Feel free to ignore if none of these address your specific case.
Author
Owner

@chriswiggins commented on GitHub (Jan 15, 2026):

Closing this in favour of #8274

@chriswiggins commented on GitHub (Jan 15, 2026): Closing this in favour of #8274
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6416