Skip to content

popcorn register github fails: incorrect_client_credentials from GitHub token exchange #535

Open

Description

@Chr0mium24

GitHub login for the CLI fails after authorizing on GitHub. The callback /auth/cli/github returns:

{"detail":"Failed to get access token from GitHub: {\"error\":\"incorrect_client_credentials\",\"error_description\":\"The client_id and/or client_secret passed are incorrect.\",\"error_uri\":\"https://docs.github.com/apps/managing-oauth-apps/troubleshooting-oauth-app-access-token-request-errors/#incorrect-client-credentials\"}"}

Steps to reproduce

  1. POPCORN_API_URL=https://site--bot--dxfjds728w5v.code.run popcorn register github (popcorn-cli 1.3.32, macOS)
  2. Authorize the OAuth app (client_id Ov23lieFd2onYk4OnKIR) in the browser.
  3. The redirect to /auth/cli/github returns the error above.

Observed: 2026-11-19, around 07:35 UTC.

Likely cause: GitHub rejects the token exchange in _handle_github_oauth (src/kernelbot/api/api_utils.py). That suggests CLI_GITHUB_CLIENT_SECRET on the API server is wrong or was rotated, or CLI_GITHUB_CLIENT_ID doesn't match the client_id the CLI hardcodes in src/cmd/auth.rs. The Discord flow works.

Side effect: the CLI saves the new cli_id to ~/.popcorn.yaml before the server-side auth succeeds. After this failure, the previous (working) login is overwritten and every request returns 401 until you run popcorn reregister discord. It might be worth saving the config only after auth is confirmed, or at least printing a warning.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions