GitHub OAuth connection fails with "redirect_uri is not associated with this application"

Aperta
#1,663 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
22/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

Reproduction is fully described, but the failing piece lives in the deployed GitHub OAuth app registration rather than obviously in this repository. Start by locating where the authorize URL is built and where the /oauth/2/callback route is registered, then compare the computed redirect URI against the callback configured for the cloud GitHub application. Done means the Connect button lands on GitHub's consent screen and returns to a working callback; if the fix is only a GitHub app setting, document that instead of changing code.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Description

I am unable to connect my GitHub account to OpenHands Cloud.

When navigating to the Integrations page and clicking Connect under GitHub, I am redirected to GitHub, where the following error is displayed:

The redirect_uri is not associated with this application.

The application might be misconfigured or could be trying to redirect you to a website you weren't expecting.

This issue occurs consistently.

Environment

Steps to reproduce

  1. Navigate to https://app.all-hands.dev/settings/integrations.
  2. Locate the GitHub integration.
  3. Click Connect.
  4. Get redirected to GitHub.
  5. GitHub displays the OAuth redirect URI error.

Expected behaviour

I should be redirected to GitHub's authorization page, be able to authorize OpenHands, and successfully connect my GitHub account.

Actual behaviour

GitHub rejects the OAuth authorization request and displays:

`The redirect_uri is not associated with this application.

The application might be misconfigured or could be trying to redirect you to a website you weren't expecting.`

The authorization URL I observed, with sensitive values redacted, is:

https://github.com/login/oauth/authorize?client_id=REDACTED&redirect_uri=https%3A%2F%2Fapp.all-hands.dev%2Foauth%2F2%2Fcallback&response_type=code&state=REDACTED&scope=repo+user%3Aemail+workflow

Additional observations

  • Connecting my GitLab account through the same OpenHands Cloud integrations page works without any issues.
  • The issue appears isolated to the GitHub integration.
  • The problem occurs before GitHub authorization can be completed.
  • This issue is not resolved by (1) logging out and logging in again; (2) clearing cookies; (3) using a different browser.

Existing issues

I checked the existing issues and could not find one describing this specific error.

Possible cause and requested investigation

This appears to be an OAuth configuration or callback URL mismatch involving the GitHub application used by OpenHands Cloud.

Could you please investigate:

  1. Whether the GitHub OAuth application's registered callback URL matches the actual redirect_uri being sent in the authorization request.
  2. Whether the callback URL is correctly configured in the GitHub application used by OpenHands Cloud.
  3. Whether the authorization request is generating the correct redirect URI.
  4. Whether any recent changes to the GitHub integration or OAuth configuration could have introduced this issue.

I suspect this may need to be addressed in the OpenHands Cloud GitHub OAuth application configuration rather than through changes to individual users' GitHub accounts.

Thank you.

Lingua principale
Python
Stelle
95
Fork
53
Merge medio
1g 2h
PR unite (30g)
146

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OpenHands/OpenHands-Cloud

Tutte le issue di OpenHands/OpenHands-Cloud

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.