openai / openai/codex

Kling CLI plugin OAuth cannot authenticate in remote ChatGPT Work runtime

Open
#42,336 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auth codex-web connectivity enhancement skills
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

Summary

The Kling AI CLI plugin is currently unusable for account authentication when it runs inside ChatGPT Work/Codex's remote, headless runtime.

Reproduction

  1. Select the Kling AI CLI plugin in ChatGPT Work/Codex.
  2. Start authentication through the plugin, which invokes the official Global CLI approximately as follows:
npm exec --yes --registry=https://registry.npmjs.org --package=@klingai/cli-global@latest -- kling login
  1. The CLI detects a headless environment and provides an OAuth authorization URL with this redirect URI:
http://127.0.0.1:8787/callback
  1. Open the authorization URL in the user's browser and approve access.
  2. Run:
kling who_am_i

Actual result

The callback reaches 127.0.0.1 on the user's local machine, rather than the remote Work/Codex runtime where the CLI is listening. The access token is never saved and kling who_am_i returns:

No login state found

Why users cannot work around this

ChatGPT Work/Codex users do not have a reachable ingress URL for the runtime and cannot configure SSH port forwarding. This is a standalone CLI invocation, not an MCP server configured through codex mcp.

Requested resolution

Please make this third-party CLI/plugin authentication flow usable in remote Codex runtimes through at least one of:

  1. Device-code / browser-code OAuth supported by the Kling CLI plugin.
  2. Secure API-key authentication supported by the plugin.
  3. A ChatGPT-managed OAuth callback instead of a loopback redirect.

Without one of these options, the advertised Kling video-generation integration cannot be authenticated by users with existing Kling accounts in ChatGPT Work.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the headless authentication flow with the documented npm exec command, then inspect how the Kling CLI plugin invokes kling login and handles the http://127.0.0.1:8787/callback redirect. Done means a remote ChatGPT Work/Codex runtime can authenticate an existing Kling account and kling who_am_i reports the saved login state without local port forwarding.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js
Domain
authentication, cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.