passbolt/passbolt_api · error · Cake\Http\Exception\NotFoundException

The ResourceType ` ` is invalid or not supported

Error message

The ResourceType `%s` is invalid or not supported

What it means

NotFoundException thrown by ScimResourceTypesController::resourceTypes when a specific resourceType is requested but ScimResourceTypes::isValid() does not recognize it. Only SCIM-supported resource types (e.g. User, Group) can be served; unknown ones produce this message.

Solutions

  1. Request the full resource type list first (omit the trailing segment) and use a name from that response
  2. Match the resource type name exactly, including capitalization, as returned by the discovery endpoint
  3. Remove unsupported resource types from the SCIM client configuration

Example fix

// before
GET /scim/v2/<id>/ResourceTypes/user
// after
GET /scim/v2/<id>/ResourceTypes/User
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED = ['User', 'Group'];
if (resourceType && !SUPPORTED.includes(resourceType)) throw new Error(`Unsupported resource type: ${resourceType}`);

Try / catch

try { await getScimResourceType(settingId, type); } catch (e) { if (e.status === 404) console.warn(`Resource type ${type} not supported, use discovery`); else throw e; }

Prevention

When it happens

Trigger: GET /scim/v2/<settingId>/ResourceTypes/<type> where <type> is misspelled, lowercased unexpectedly, or simply not a resource type supported by this SCIM implementation.

Common situations: SCIM client discovery configured with a resource type name from another SCIM provider; case mismatch (e.g. 'user' vs 'User'); requesting custom resource types not implemented in Passbolt's SCIM subset.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of passbolt/passbolt_api@31c1bbc10f (2026-09-17). Data as JSON: /api/errors/205dee23d09b593f. Report an issue: GitHub.

Appendix: source

Thrown at plugins/PassboltEe/Scim/src/Controller/V2/ScimResourceTypesController.php:38

use Cake\Http\Exception\NotFoundException;
use Exception;
use Passbolt\Scim\Utility\Object\ListResponse;
use Passbolt\Scim\Utility\ScimResourceTypes;

class ScimResourceTypesController extends AbstractScimController
{
    /**
     * /ResourceTypes SCIM Endpoint (Unauthenticated)
     *
     * @param string $settingId Org Setting Id
     * @param string|null $resourceType Resource Type (User, Group)
     * @return void
     */
    public function resourceTypes(string $settingId, ?string $resourceType = null): void
    {
        try {
            if ($resourceType && !ScimResourceTypes::isValid($resourceType)) {
                throw new NotFoundException(
                    sprintf('The ResourceType `%s` is invalid or not supported', $resourceType)
                );
            }

            if ($resourceType) {
                $responseData = ScimResourceTypes::build($resourceType);
            } else {
                $resourceTypes = ScimResourceTypes::getAll();
                $responseData = new ListResponse($resourceTypes, totalResults: count($resourceTypes));
            }
            $this->processResponse($settingId, $responseData);
        } catch (Exception $e) {
            $this->processException($settingId, $e);
        }
    }
}

View on GitHub (pinned to 31c1bbc10f)