task: PATCH custom_fields returns 1470403 with DPoP user token, works with Bearer
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 22/100
Research direction
The bug sits in the DPoP token path of the Go CLI when calling the Lark task v2 PATCH endpoint with update_fields custom_fields. Start from the repro: config set dpop preferred, then task tasks patch with custom_fields. Compare the request against a Bearer run to find where the permission check diverges. Done means a DPoP-bound user token can update a custom field on an existing task and the Bearer path is unchanged.
Written by the indexing model from the issue text.
Description
Summary
With a DPoP-bound user access token, updating a custom field value on an existing task (PATCH /open-apis/task/v2/tasks/:task_guid with update_fields: ["custom_fields"]) always fails with 1470403 ("user lacks permission for the requested resource"). The same request succeeds after re-authorizing with lark-cli config set dpop disabled (Bearer token). Other operations work fine with the DPoP token, including setting custom field values at task creation.
Environment
- lark-cli 1.0.98 (npm), Windows 11, brand
lark - DPoP mode
preferred, key providerwindows-platform-ksp - User identity (
--as user), the user is the owner of the tasklist and creator/assignee of the task
Steps to reproduce
lark-cli config set dpop preferred, thenlark-cli auth login --recommend(token type: DPoP; scopes includetask:task:writeandtask:custom_field:write).- Create a tasklist, then a single-select or text custom field on it (
task custom_fields create,resource_type: tasklist). - Create a task in that tasklist.
- Update the field value:
lark-cli task tasks patch --as user --params '{"task_guid":"<TASK_GUID>"}' \
--data '{"task":{"custom_fields":[{"guid":"<FIELD_GUID>","text_value":"x"}]},"update_fields":["custom_fields"]}'
Actual result
"code": 1470403,
"message": "user lacks permission for the requested resource"
Expected result
The value is updated, as it is in the Lark client by the same user, and as it is with a Bearer token.
What we checked (all with the same user and app)
| Token | Scopes | Operation | Result |
|---|---|---|---|
| DPoP | task, contact, wiki, docs, drive, base, sheets, calendar, vc | PATCH custom_fields on existing task | 1470403 |
| DPoP | --recommend (all) |
PATCH custom_fields on existing task | 1470403 |
| Bearer | --recommend (all) |
PATCH custom_fields on existing task | OK |
| DPoP | any of the above | PATCH summary on the same task | OK |
| DPoP | any of the above | PATCH summary + custom_fields together | 1470403 |
| DPoP | any of the above | create task with custom_fields values |
OK |
| DPoP | any of the above | raw lark-cli api PATCH ... |
1470403 |
- Single-select and text fields behave the same.
- Adding the user explicitly as
editormember, or adding the app as a tasklist member, does not help. - The same user can set the value in the Lark client without problems.
So the field permission check on task update seems not to accept DPoP-bound user tokens, while task edit permission and field writes on create do.
Workaround
lark-cli config set dpop disabled and re-authorize (Bearer token).
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from larksuite/cli
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
domain/im
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
bug domain/doc
Difficulty 1/5 Under an hour Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
mail: all-ASCII draft bodies are hard-wrapped every 998 bytes, inserting newlines inside words and tagsPossibly taken @linye157 claimed this 26 days ago. Opendomain/mail
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Maintainers usually reply within 1 day
-
auth: a 429 from the Token Endpoint during refresh deletes a still-valid loginPossibly taken @linye157 claimed this 26 days ago. Openbug domain/auth domain/im
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
larksuite/cli#2869 · 5 comments ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
github/github-mcp-server#3960 ·
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
JuliusBrussee/caveman#1594 ·
Maintainers usually reply within 1 day
-
C-bug O-community X-blathers-triaged
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
cockroachdb/cockroach#176264 · 1 comment ·
-
security trivy
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
kubefleet-dev/kubefleet#1068 ·
Maintainers usually reply within 3 days