{"record":{"id":"823b48196b248564","repo":"jumpserver/jumpserver","slug":"the-value-in-the-parameter-must-contain-s","errorCode":null,"errorMessage":"The value in the parameter must contain %s","messagePattern":"The value in the parameter must contain (.+?)","errorType":"http","errorClass":"JMSException","httpStatus":400,"severity":"error","filePath":"apps/authentication/api/common.py","lineNumber":33,"sourceCode":"logger = get_logger(__file__)\n\n\nclass QRUnBindBase(APIView):\n    user: User\n\n    def post(self, request: Request, backend: str, **kwargs):\n        backend_map = {\n            'wecom': {'user_field': 'wecom_id', 'not_bind_err': errors.WeComNotBound},\n            'dingtalk': {'user_field': 'dingtalk_id', 'not_bind_err': errors.DingTalkNotBound},\n            'feishu': {'user_field': 'feishu_id', 'not_bind_err': errors.FeiShuNotBound},\n            'lark': {'user_field': 'lark_id', 'not_bind_err': errors.LarkNotBound},\n            'slack': {'user_field': 'slack_id', 'not_bind_err': errors.SlackNotBound},\n        }\n        user = self.user\n\n        backend_info = backend_map.get(backend)\n        if not backend_info:\n            raise JMSException(\n                _('The value in the parameter must contain %s') % ', '.join(backend_map.keys())\n            )\n\n        if not getattr(user, backend_info['user_field'], None):\n            raise backend_info['not_bind_err']\n\n        setattr(user, backend_info['user_field'], None)\n        user.save()\n        return Response()\n\n\nclass QRUnBindForUserApi(RoleUserMixin, QRUnBindBase):\n    permission_classes = (IsValidUser, UserConfirmation.require(ConfirmType.RELOGIN),)\n\n\nclass QRUnBindForAdminApi(RoleAdminMixin, QRUnBindBase):\n    permission_classes = (OnlySuperUser,)\n    user_id_url_kwarg = 'user_id'","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/jumpserver/jumpserver/blob/6ec464fabd61b95912d539455a3a5f15f5c59fe0/apps/authentication/api/common.py#L15-L51","documentation":"Raised by the third-party-backend unbinding endpoint (common.py) when the `backend` parameter passed to the request does not match any supported backend key in backend_map (e.g. 'slack'). The message interpolates the allowed keys, telling the caller which backend names are accepted.","triggerScenarios":"POSTing to the unbind/social-account endpoint with backend missing, misspelled, or unsupported (e.g. backend=dingtalk when only keys like 'slack' exist), or omitting it so backend_map.get(backend) returns None.","commonSituations":"Frontend sends a stale or renamed backend name after an upgrade; developer copies an example that references a backend not enabled in this installation; trailing whitespace/case mismatch in the query or body parameter.","solutions":["Check the error message: it lists the exact valid backend values (e.g. 'slack'); resend the request with one of those","Verify the parameter name and that it is transmitted in the place the serializer expects (body vs query string)","Update the frontend/backend constant list to match apps/authentication/api/common.py backend_map keys"],"exampleFix":"# before\nPOST /api/v1/authentication/users/backends/unbind/\n{\"backend\": \"Slack\"}\n# after\nPOST /api/v1/authentication/users/backends/unbind/\n{\"backend\": \"slack\"}","handlingStrategy":"validation","validationCode":"valid_backends = ['slack']  # keep in sync with backend_map keys\nif backend not in valid_backends:\n    raise ValueError(f\"backend must be one of {valid_backends}\")\nunbind(backend)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Centralize the backend-name constant shared by frontend and backend","Return allowed values in API error responses so clients can self-correct"],"tags":["authentication","social-login","parameter-validation"],"backgroundTag":"invalid-parameter-value","analyzedSha":"6ec464fabd61b95912d539455a3a5f15f5c59fe0","analyzedAt":"2026-08-28T11:33:00.925Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}