{"record":{"id":"9f5eedadfedab4ca","repo":"passbolt/passbolt_api","slug":"the-resource-type-s-is-not-valid","errorCode":null,"errorMessage":"The resource type `%s` is not valid","messagePattern":"The resource type `(.+?)` is not valid","errorType":"exception","errorClass":"Cake\\Http\\Exception\\BadRequestException","httpStatus":400,"severity":"warning","filePath":"plugins/PassboltEe/Scim/src/Utility/Object/ListResponse.php","lineNumber":87,"sourceCode":"\n    /**\n     * Fetch resources based on the type, filter and pagination config\n     *\n     * @param string $resourceType\n     * @param int|null $startIndex\n     * @param int|null $count\n     * @param string|null $filter\n     * @return $this\n     * @throws \\Exception\n     */\n    public function fetchResources(\n        string $resourceType,\n        ?int $startIndex = null,\n        ?int $count = null,\n        ?string $filter = null,\n    ) {\n        if (!ScimResources::isValid($resourceType)) {\n            throw new BadRequestException(sprintf('The resource type `%s` is not valid', $resourceType));\n        }\n        if (!isset(ScimEntry::MODEL_MAP[$resourceType])) {\n            throw new BadRequestException(\n                sprintf('The resource type `%s` has not map for scim entry model', $resourceType)\n            );\n        }\n\n        if ($startIndex !== null && $startIndex > 0) {\n            $this->startIndex = $startIndex;\n        }\n        if ($count !== null && $count > 0) {\n            $this->itemsPerPage = $count;\n        }\n\n        /** @var \\Passbolt\\Scim\\Model\\Table\\ScimEntriesTable $scimEntriesTable */\n        $scimEntriesTable = $this->fetchTable('Passbolt/Scim.ScimEntries');\n        $conditions = [\n            $scimEntriesTable->aliasField('foreign_model') => ScimEntry::MODEL_MAP[$resourceType],","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/plugins/PassboltEe/Scim/src/Utility/Object/ListResponse.php#L69-L105","documentation":"ListResponse::fetchResources() first checks the resource type against ScimResources::isValid(); only 'Users' and 'Groups' are valid SCIM resource types in this implementation. Any other value in the SCIM list endpoint URL triggers a BadRequestException. This validates the /scim/v2/<type> path segment before any database work.","triggerScenarios":"GET /scim/v2/<resourceType> (list endpoint) where resourceType is not Users or Groups — e.g. /scim/v2/users (lowercase), /scim/v2/User, /scim/v2/Entitlements, or URL-encoding artifacts.","commonSituations":"IdP/SCIM clients (Azure AD/Entra, Okta) configured with a wrong base URL or supporting resource types this plugin doesn't implement (e.g. custom schemas); case-sensitivity bugs in client route building; proxies rewriting paths.","solutions":["Use the exact resource types 'Users' and 'Groups' (capitalized) in the SCIM endpoint URL.","Check the IdP's SCIM connector configuration and set the base endpoint correctly, e.g. https://passbolt.example.com/scim/v2/ with default user/group resource paths.","Disable unsupported SCIM resource/sync features in the IdP connector if it requests types outside Users/Groups."],"exampleFix":"// before\nGET /scim/v2/users?filter=userName eq \"ada\"\n// after\nGET /scim/v2/Users?filter=userName eq \"ada\"","handlingStrategy":"validation","validationCode":"const VALID = ['Users', 'Groups'];\nif (!VALID.includes(resourceType)) {\n  throw new Error(`SCIM resource type must be exactly one of ${VALID}, got: ${resourceType}`);\n}","typeGuard":"const isScimResourceType = (t) => t === 'Users' || t === 'Groups';","tryCatchPattern":"try {\n  const res = await fetch(`${base}/scim/v2/${resourceType}`);\n  if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);\n} catch (e) {\n  if (/resource type .* is not valid/.test(e.message)) console.error('Fix IdP connector endpoint paths to Users/Groups');\n}","preventionTips":["Use exact capitalized 'Users' and 'Groups' path segments.","Point the IdP connector base URL at /scim/v2/ without extra path components.","Disable unsupported resource syncs (e.g. entitlements) in the IdP provisioning app."],"tags":["scim","php","rest","bad-request","enum"],"backgroundTag":"invalid-enum-value","analyzedSha":"31c1bbc10f32808a607fa9bd81891e898779c0bc","analyzedAt":"2026-09-17T00:04:38.960Z","contentChangedAt":"2026-09-17T00:04:38.960Z","schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}