{"record":{"id":"5a1bb94c40d202be","repo":"chenhg5/cc-connect","slug":"authorization-denied-by-user","errorCode":null,"errorMessage":"authorization denied by user","messagePattern":"authorization denied by user","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cc-connect/feishu.go","lineNumber":629,"sourceCode":"\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tif pollRes.ClientID != \"\" && pollRes.ClientSecret != \"\" {\n\t\t\treturn &registrationFlowResult{\n\t\t\t\tAppID:       pollRes.ClientID,\n\t\t\t\tAppSecret:   pollRes.ClientSecret,\n\t\t\t\tOwnerOpenID: pollRes.UserInfo.OpenID,\n\t\t\t\tPlatform:    platformType,\n\t\t\t}, nil\n\t\t}\n\n\t\tswitch pollRes.Error {\n\t\tcase \"\", \"authorization_pending\":\n\t\tcase \"slow_down\":\n\t\t\tinterval += 5\n\t\tcase \"access_denied\":\n\t\t\treturn nil, fmt.Errorf(\"authorization denied by user\")\n\t\tcase \"expired_token\":\n\t\t\treturn nil, fmt.Errorf(\"onboarding session expired\")\n\t\tdefault:\n\t\t\tif pollRes.Error != \"\" {\n\t\t\t\treturn nil, fmt.Errorf(\"%s: %s\", pollRes.Error, pollRes.ErrorDescription)\n\t\t\t}\n\t\t}\n\n\t\ttime.Sleep(time.Duration(interval) * time.Second)\n\t}\n\n\treturn nil, fmt.Errorf(\"timed out waiting for QR onboarding result\")\n}\n\nfunc (c *registrationClient) registrationCall(action string, params map[string]string, out any) error {\n\tform := url.Values{}\n\tform.Set(\"action\", action)\n\tfor k, v := range params {","sourceCodeStart":611,"sourceCodeEnd":647,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/cmd/cc-connect/feishu.go#L611-L647","documentation":"The user explicitly denied the authorization request during QR onboarding: the poll response carried error=access_denied. This is a deliberate user action (declining the bot creation/authorization in the Feishu/Lark app), so the flow stops immediately instead of continuing to poll.","triggerScenarios":"During the poll loop the server returns pollRes.Error == \"access_denied\", i.e. the user scanned the QR code and tapped 'deny' on the consent screen.","commonSituations":"User scanning the QR but rejecting the permission request; an admin or the wrong person scanning and denying; accidental tap on the mobile app consent dialog.","solutions":["Re-run the setup command to generate a fresh QR code and approve the authorization this time.","Ensure the person scanning is the intended account owner with rights to create/authorize the bot.","Read any tenant policy restrictions first — if the tenant blocks personal-agent creation, approval will keep being denied.","If denial was accidental, no state needs cleanup; a new device-code session is issued on each setup run."],"exampleFix":"// before\n// user taps 'Deny' in Feishu app → authorization denied by user\n// after\n$ cc-connect setup feishu   # rescan QR and tap 'Allow'","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := runRegistrationFlow(...); err != nil {\n\tif strings.Contains(err.Error(), \"authorization denied by user\") {\n\t\tfmt.Println(\"Authorization was denied. Re-run setup and tap Allow in the Feishu app.\")\n\t\treturn nil // user-actionable, not a system fault\n\t}\n\treturn err\n}","preventionTips":["Scan and approve with an account that has rights to create the bot.","Do not tap Deny on the consent screen by accident; re-run setup for a fresh QR.","Check tenant policies beforehand if personal-agent creation is restricted."],"tags":["feishu","oauth","user-denied","onboarding"],"backgroundTag":"permission-denied","analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}