larksuite / larksuite/cli

Windows: token not persisted to keychain after successful OAuth authorization

Open
#1,552 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug domain/auth
Dominant language
Go
Stars
17.3k
Forks
1.4k
Avg merge
2d 4h
Merged PRs (30d)
105

Description

Bug Description

lark-cli v1.0.56 on Windows 24H2 (Node v24.17.0) cannot persist user tokens to the Windows Credential Manager. Authorization succeeds (API returns 200 with valid token), but subsequent lark-cli auth status reports no_token, and Windows Credential Manager shows no lark-cli entries.

Steps to Reproduce

$env:Path = "C:\Program Files\nodejs;C:\Users\yangdh\AppData\Roaming\npm;" + $env:Path
lark-cli config init --new

(complete browser OAuth, app configured successfully)

2. ```cmd
lark-cli auth login --recommend

(scan QR / open link, authorization succeeds in browser)

lark-cli auth status

(shows user identity missing: `no_token`)

## Expected Behavior

Token should be persisted to Windows Credential Manager and `lark-cli auth status` should show user identity as ready.

## Actual Behavior

Authorization completes successfully (API returns 200), but the token is never written to the Windows Credential Manager. `lark-cli auth status` consistently shows:

```json
{
  "status": "missing",
  "message": "User identity: missing (no token in keychain for ou_xxx)"
}

cmdkey /list returns * NONE *, confirming no credentials were stored. Bot identity (app_id + app_secret) works fine.

Environment

  • OS: Windows 11 24H2
  • lark-cli version: 1.0.56
  • Node.js: v24.17.0
  • Installed via: npm install -g @larksuite/cli
  • Brand: feishu

Additional Context

  • Tried both --recommend and --no-wait --json + --device-code flows — both return tokens but fail to persist
  • Tried running in normal desktop cmd (outside sandbox) — same result
  • Bot identity (app_id/app_secret) works without issues
  • Tried lark-cli update — already at latest (1.0.56)

Contributor guide

No contributing guide indexed for this repository

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 issue with lark-cli auth login --recommend and the --no-wait --json plus --device-code flow, then compare lark-cli auth status with cmdkey /list on Windows. Trace the authentication entry points that receive the successful token and persist it to the Windows Credential Manager; done means the credential is stored and auth status reports the user identity as ready.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, node.js
Domain
authentication, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.