{"record":{"id":"1408ad3f7b958a21","repo":"SigNoz/signoz","slug":"codeinvalidinput-1408ad","errorCode":"CodeInvalidInput","errorMessage":"clientId is required","messagePattern":"clientId is required","errorType":"validation","errorClass":"errors SigNozError","httpStatus":400,"severity":"error","filePath":"pkg/types/authtypes/google.go","lineNumber":54,"sourceCode":"\n\t// Optional list of allowed groups\n\t// If this is present, only users belonging to one of these groups will be allowed to login\n\tAllowedGroups []string `json:\"allowedGroups,omitempty\"`\n\n\t// Whether to skip email verification. Defaults to \"false\"\n\tInsecureSkipEmailVerified bool `json:\"insecureSkipEmailVerified\"`\n}\n\nfunc (config *GoogleConfig) UnmarshalJSON(data []byte) error {\n\ttype Alias GoogleConfig\n\n\tvar temp Alias\n\tif err := json.Unmarshal(data, &temp); err != nil {\n\t\treturn err\n\t}\n\n\tif temp.ClientID == \"\" {\n\t\treturn errors.New(errors.TypeInvalidInput, errors.CodeInvalidInput, \"clientId is required\")\n\t}\n\n\tif temp.ClientSecret == \"\" {\n\t\treturn errors.New(errors.TypeInvalidInput, errors.CodeInvalidInput, \"clientSecret is required\")\n\t}\n\n\tif temp.FetchGroups {\n\t\tif len(temp.DomainToAdminEmail) == 0 {\n\t\t\treturn errors.New(errors.TypeInvalidInput, errors.CodeInvalidInput, \"domainToAdminEmail is required if fetchGroups is true\")\n\t\t}\n\n\t\tif temp.ServiceAccountJSON == \"\" {\n\t\t\treturn errors.New(errors.TypeInvalidInput, errors.CodeInvalidInput, \"serviceAccountJSON is required if fetchGroups is true\")\n\t\t}\n\t}\n\n\tif len(temp.AllowedGroups) > 0 && !temp.FetchGroups {\n\t\treturn errors.New(errors.TypeInvalidInput, errors.CodeInvalidInput, \"fetchGroups must be true when allowedGroups is configured\")","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/types/authtypes/google.go#L36-L72","documentation":"Returned by the Google auth config's UnmarshalJSON when the payload has no clientId. This config drives Google OAuth integration, and a client ID is mandatory before secret/group settings are validated.","triggerScenarios":"Submitting the Google integration JSON config without clientId or with an empty string, which is unmarshalled into the Google auth Alias type.","commonSituations":"Copy-pasting integration config and missing the client ID, using the wrong JSON key (client_id), or pasting only the client secret after credential rotation.","solutions":["Add the non-empty \"clientId\" from the Google OAuth client credentials","Verify the JSON key spelling is exactly clientId (camelCase) and matches the struct tags","Regenerate OAuth credentials in Google Cloud Console if unsure of the client ID"],"exampleFix":"// before\n{\"clientSecret\": \"shh\"}\n// after\n{\"clientId\": \"123456.apps.googleusercontent.com\", \"clientSecret\": \"shh\"}","handlingStrategy":"validation","validationCode":"if (!cfg.clientId?.trim()) {\n  throw new Error(\"clientId is required\");\n}","typeGuard":"function hasClientId(c: unknown): c is { clientId: string } {\n  return typeof c === \"object\" && c !== null && typeof (c as any).clientId === \"string\" && (c as any).clientId !== \"\";\n}","tryCatchPattern":"try { await saveGoogleConfig(cfg); } catch (e) { if (String(e).includes(\"clientId is required\")) highlightField(\"clientId\"); else throw e; }","preventionTips":["Validate OAuth credentials client-side before posting","Store clientId/secret as a pair in your secret manager so they are never half-applied"],"tags":["auth","google-oauth","json-validation","invalid-input"],"backgroundTag":"missing-required-json-field","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}