{"record":{"id":"4c892de4e84d1646","repo":"chenhg5/cc-connect","slug":"current-environment-does-not-support-client-secret","errorCode":null,"errorMessage":"current environment does not support client_secret auth","messagePattern":"current environment does not support client_secret auth","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cc-connect/feishu.go","lineNumber":552,"sourceCode":"func runRegistrationFlow(opts registrationFlowOptions) (*registrationFlowResult, error) {\n\tif opts.TimeoutSeconds <= 0 {\n\t\topts.TimeoutSeconds = 600\n\t}\n\tclient := &registrationClient{\n\t\tbaseURL: accountsFeishuBaseURL,\n\t\thttp:    &http.Client{Timeout: 15 * time.Second},\n\t\tdebug:   opts.Debug,\n\t}\n\n\tvar initRes registrationInitResponse\n\tif err := client.registrationCall(\"init\", nil, &initRes); err != nil {\n\t\treturn nil, fmt.Errorf(\"init failed: %w\", err)\n\t}\n\tif initRes.Error != \"\" {\n\t\treturn nil, fmt.Errorf(\"%s: %s\", initRes.Error, initRes.ErrorDescription)\n\t}\n\tif len(initRes.SupportedAuthMethods) > 0 && !containsString(initRes.SupportedAuthMethods, \"client_secret\") {\n\t\treturn nil, fmt.Errorf(\"current environment does not support client_secret auth\")\n\t}\n\n\tvar beginRes registrationBeginResponse\n\tbeginParams := map[string]string{\n\t\t\"archetype\":         \"PersonalAgent\",\n\t\t\"auth_method\":       \"client_secret\",\n\t\t\"request_user_info\": \"open_id\",\n\t}\n\tif err := client.registrationCall(\"begin\", beginParams, &beginRes); err != nil {\n\t\treturn nil, fmt.Errorf(\"begin failed: %w\", err)\n\t}\n\tif beginRes.Error != \"\" {\n\t\treturn nil, fmt.Errorf(\"%s: %s\", beginRes.Error, beginRes.ErrorDescription)\n\t}\n\tif beginRes.DeviceCode == \"\" || beginRes.VerificationURIComplete == \"\" {\n\t\treturn nil, fmt.Errorf(\"incomplete onboarding response\")\n\t}\n","sourceCodeStart":534,"sourceCodeEnd":570,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/cmd/cc-connect/feishu.go#L534-L570","documentation":"This error is thrown during the Feishu/Lark bot registration (QR onboarding) flow when the remote registration service's 'init' response reports a list of supported auth methods that does not include 'client_secret'. The flow only supports registering the bot via the client_secret auth method, so it aborts early rather than proceeding to a doomed device-code exchange. It indicates a server-side/environment restriction, not a local code bug.","triggerScenarios":"runRegistrationFlow calls registrationCall(\"init\") and the response contains a non-empty SupportedAuthMethods array that lacks the \"client_secret\" entry (e.g. only [\"qr_code\"] or [\"oauth_code\"]).","commonSituations":"Registering a bot in a Feishu/Lark tenant or environment where the onboarding API has disabled client_secret-based onboarding; using an older/self-hosted registration endpoint with a restricted auth-method policy; environment policy changes rolled out server-side after a working setup.","solutions":["Check the environment/tenant: switch to a Feishu/Lark environment that permits client_secret-based onboarding (or a different baseURL, e.g. the Lark accounts endpoint if registering a Lark tenant).","Inspect the debug output (registrationClient debug mode) to see the actual SupportedAuthMethods list returned by init and confirm what is supported.","Upgrade cc-connect to a version that supports the auth methods your environment offers, or use an alternate setup path (manual app credentials in config.toml instead of QR onboarding).","Contact Feishu/Lark open-platform support to enable client_secret auth for your environment if it should be supported."],"exampleFix":"// before\nif len(initRes.SupportedAuthMethods) > 0 && !containsString(initRes.SupportedAuthMethods, \"client_secret\") {\n\treturn nil, fmt.Errorf(\"current environment does not support client_secret auth\")\n}\n// after\n// no code fix: pick an auth method the environment supports\n// e.g. re-run setup against the Lark endpoint:\n//   cc-connect setup feishu --base-url https://accounts.larksuite.com\n// or configure app_id/app_secret manually in config.toml","handlingStrategy":"validation","validationCode":"// cannot pre-validate remotely; but before running setup you can check which platform env you target\nif strings.Contains(os.Getenv(\"CC_CONNECT_REGION\"), \"lark\") {\n\t// ensure setup uses the Lark endpoint that supports client_secret\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Confirm your tenant/environment supports client_secret onboarding before automating setup.","Pin a cc-connect version compatible with your region's registration API.","Keep manual app_id/app_secret config.toml setup as an alternative path."],"tags":["feishu","oauth","registration","onboarding"],"backgroundTag":"unsupported-operation","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"}