Lark international app registration fails after mobile confirmation; app credentials are never returned

Open
#2,873 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Active
Tech stack
go, javascript, node.js

Research direction

Start with the CLI 1.0.98 registration implementation and the SDK registration flow described in the report; trace the international Lark handoff through application initialization, configuration, and the registration finish stage. The report does not identify source files or provide response bodies/status codes, so first establish how to safely obtain the finish error or request ID; done means the flow returns credentials to the originating CLI/SDK, or reports an actionable failure.

Written by the indexing model from the issue text.

Description

bug domain/auth domain/core

We are integrating the official CLI into a per-user web connection flow. Each attempt has a fresh private HOME and config directory. No existing user tokens or application secrets are imported.

Versions: @larksuite/cli 1.0.98; @larksuiteoapi/node-sdk 1.76.0.

Primary reproduction:

  1. Start the official CLI with lark-cli config init --new --brand lark in a new private HOME, with LARKSUITE_CLI_CONFIG_DIR pointing to a new private config directory.
  2. Generate a QR from the exact emitted verification URL using lark-cli auth qrcode.
  3. Scan using a signed-in Lark international account. The account can access its own developer console and existing enabled custom applications.
  4. Both Create and Use Existing App reach a mobile error: "Couldn't complete app setup. An error occurred during the process. Please try creating it again."
  5. No application configuration or credentials are returned to the CLI. It remains pending until cancelled.

Independent official SDK reproduction:

await lark.registerApp({
  source: 'fromplan',
  createOnly: true,
  addons: {
    preset: false,
    scopes: { user: ['bitable:app', 'offline_access'] },
  },
  signal,
  onQRCodeReady: ({ url }) => showExactUrlAndQR(url),
});

Using the default SDK accounts domains and exact returned URL, the Lark mobile page reports "Couldn't create app". No registration result is returned before cancellation. A contemporaneous application appears in the developer console; the correlation suggests creation may occur before the failure, but we cannot prove that correlation from the registration receipt because none arrives.

Additional diagnostic control: with domain and larkDomain both set to accounts.larksuite.com, and appId set to an application owned by the same account, the exact SDK-generated /page/launcher URL shows "Link expired" before any confirmation. Browser console contains exactly ACK app registration failed Error, with no error code. No page has been modified and no cookies or hidden browser state have been extracted.

Source observation: the CLI 1.0.98 registration implementation bootstraps on accounts.feishu.cn, presents a Lark /page/cli URL, and switches polling domains after tenant-brand detection. The SDK default uses the server-returned /page/launcher URL. The observations above do not establish which protocol hop fails.

Expected: the official registration flow returns client_id and client_secret directly to the originating CLI or SDK, without asking end users to copy a Secret from the developer console.

Questions: Is PersonalAgent/client_secret app registration currently supported for international Lark accounts through these released versions? Is there a required region-specific registration/ACK sequence? What safe request identifier can we collect to diagnose the generic ACK error?

No account identifiers, app IDs, secrets, tokens, device/user codes, QR images or authorization URLs are included in this report.

Follow-up: the desktop flow reaches registration finish

We reproduced the existing-app failure on the official desktop CLI page, using a fresh website-owned isolated CLI session. The session still had more than 3,600 seconds remaining when checked. No additional permissions page appeared. The developer console showed the selected custom app enabled and published; its credentials section displayed a masked App Secret field with no visible restriction notice. We did not reveal, copy, or reset that Secret.

The built-in browser's observed-resource inventory includes these request paths (application-specific path segments omitted):

  • /developers/v1/app_registration/ack
  • Application metadata, scopes, events, callbacks, secret, and version read endpoints
  • /developers/v1/app_registration/finish

The page then displayed the same generic setup failure. The private CLI profile still had no application configuration, and personal device authorization had not started. Thus the original CLI flow can pass its initial ACK; the ACK error observed in the separate SDK diagnostic should not be generalized to the CLI reproduction. The deployed page source also calls registration finish after application initialization/configuration, and uses generic failure UI around that path.

The developer console's Server Log Search returned no results for the matching test interval. The allowed browser interface provides observed request URLs but not response bodies or status codes, so we cannot supply or infer the rejection code from finish. We are not asserting a region, policy, or permission root cause without that response.

Could maintainers investigate the international Lark registration finish stage, or suggest a supported way to obtain the relevant error code/request ID when the official UI only displays this generic failure?

Follow-up: Back can show success without a completed handoff

After the official page displayed the generic app-setup failure, clicking its Back button displayed:

App updated
Go to the CLI, and your Lark app is ready to go.

The person operating the page explicitly confirmed this failure -> Back -> success sequence. At the subsequent check, the website was still waiting at the application-registration phase, the isolated CLI profile had no config.json, and personal authorization had not started. The success-page resource inventory includes ACK and finish request paths, but does not expose their response status/body; their presence alone is not proof of a successful handoff.

Please distinguish this success presentation from actual delivery of client_id/client_secret. The Back result explains why the user saw contradictory UI, but does not establish the cause of the original finish failure.

Dominant language
Go
Stars
18.2k
Forks
1.4k
Avg merge
1d 3h
Merged PRs (30d)
18

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No 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.

More from larksuite/cli

All issues in larksuite/cli

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.