mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[GH-ISSUE #5657] [bug]: OAUTH_TOKEN_INVALID_RESPONSE when generate Oauth2.0 token with browser extension #2193
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#2193
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Leon-Luu on GitHub (Dec 4, 2025).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/5657
Is there an existing issue for this?
Platform
Web App
Browser
Chrome
Operating System
Windows
Bug Description
When attempt to "Generate Token" with OAuth2.0 Client Credential in the Collection properties using the "Browser extension" interceptor we will see OAUTH_TOKEN_INVALID_RESPONSE / "Failed to fetch token" as response. This is NOT happening if we switch to other interceptor like proxy/Agents where successful token is returned.
Please check and fix why this is happening only with the browser extension interceptor.
Step to step:
Deployment Type
Hoppscotch Cloud
Version
2025.11.0
@Leon-Luu commented on GitHub (Feb 18, 2026):
What's actually happening:
The extension's service worker uses fetch() (in src/index.ts). The request construction is correct — URL-encoded body, proper headers, proper method. The response processing (base64 round-trip) is also correct. But Chrome's service worker fetch() adds browser-level headers (like Origin) that the proxy/agent paths don't add, because those make server-side requests without browser baggage.
When the OAuth server gets the extension's request, it returns an error response (e.g., HTTP 400 [{"error":"invalid_client"}].
The fix would need to happen in the browser extension itself (e.g., stripping browser-added headers) or by routing OAuth token requests through the proxy even when the extension is the active interceptor.