Skip to content

Fix X OAuth login by moving endpoints to x.com - #1

Merged
iconidentify merged 1 commit into
mainfrom
fix/x-oauth-x-com-domain
May 31, 2026
Merged

iconidentify merged 1 commit into
mainfrom
fix/x-oauth-x-com-domain

Conversation

@iconidentify

Copy link
Copy Markdown
Owner

Problem

Users are stuck in a "you need to be logged into X" loop when logging in with X in production. They never make it back to our callback (confirmed: live prod log tail captured nothing during a real login attempt).

Root cause

XApi20.java hardcoded the authorization endpoint to https://twitter.com/i/oauth2/authorize. X migrated the consumer experience off twitter.com, so a logged-in user's session cookie now lives on x.com. The twitter.com authorize page can't see that session, trapping the user before the OAuth flow returns to our callback. This is an external change on X's side, which matches "can't log in any longer".

Fix

Move the OAuth endpoints to x.com / api.x.com:

  • authorize: twitter.com/i/oauth2/authorize -> x.com/i/oauth2/authorize
  • token: api.twitter.com/2/oauth2/token -> api.x.com/2/oauth2/token
  • user info: api.twitter.com/2/users/me -> api.x.com/2/users/me

Verification

  • Confirmed prod is on a 56-day-old pod running the old image; credentials in dialtone-secrets are valid (token endpoint returns invalid_request for a dummy code, not unauthorized_client).
  • Probed the new hosts live: authorize returns 200, token endpoint accepts the prod credentials.
  • Compiles clean.

Still pending: a real end-to-end login through the new x.com flow once deployed, since an interactive authorize can't be completed headlessly.

🤖 Generated with Claude Code

X migrated the consumer experience off twitter.com, so a logged-in
user's session cookie now lives on x.com. Serving the authorization
page from twitter.com/i/oauth2/authorize left it unable to see that
session, trapping users in a "you need to be logged into X" loop
before the flow ever returned to our callback.

Move the authorize, token, and user-info endpoints to x.com /
api.x.com. Verified the new hosts respond as expected (authorize 200;
token returns invalid_request for a dummy code, confirming the prod
credentials are still accepted).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@iconidentify
iconidentify merged commit f919588 into main May 31, 2026
3 checks passed
@iconidentify
iconidentify deleted the fix/x-oauth-x-com-domain branch May 31, 2026 20:22
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

Successfully merging this pull request may close these issues.

1 participant