{"record":{"id":"ab3d723bf00ec6c0","repo":"passbolt/passbolt_api","slug":"service-provider-missing","errorCode":null,"errorMessage":"Service provider missing.","messagePattern":"Service provider missing\\.","errorType":"http","errorClass":"BadRequestException","httpStatus":400,"severity":"error","filePath":"plugins/PassboltEe/Sso/src/Service/SsoSettings/SsoSettingsSetService.php","lineNumber":151,"sourceCode":"                $gpg->setEncryptKeyFromFingerprint($fingerprint);\n            } catch (Exception $exception) {\n                $msg = __('The OpenPGP server key defined in the config cannot be used to encrypt.') . ' ';\n                $msg .= $exception->getMessage();\n                throw new InternalErrorException($msg, 500, $exception);\n            }\n        }\n\n        return $gpg->encrypt($jsonData, true);\n    }\n\n    /**\n     * @param array $data payload\n     * @return \\Passbolt\\Sso\\Form\\BaseSsoSettingsForm\n     */\n    protected function getSsoSettingsForm(array $data): BaseSsoSettingsForm\n    {\n        if (!isset($data['provider'])) {\n            throw new BadRequestException('Service provider missing.');\n        }\n        if (!is_string($data['provider'])) {\n            throw new BadRequestException('Service provider invalid.');\n        }\n        if (!in_array($data['provider'], SsoSetting::ALLOWED_PROVIDERS)) {\n            throw new BadRequestException('Service provider not supported.');\n        }\n\n        switch ($data['provider']) {\n            case SsoSetting::PROVIDER_AZURE:\n                return new SsoSettingsAzureDataForm();\n            case SsoSetting::PROVIDER_GOOGLE:\n                return new SsoSettingsGoogleDataForm();\n            case SsoSetting::PROVIDER_OAUTH2:\n                return new SsoSettingsOAuth2DataForm();\n            case SsoSetting::PROVIDER_ADFS:\n                return new SsoSettingsAdfsDataForm();\n            case SsoSetting::PROVIDER_PINGONE:","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/plugins/PassboltEe/Sso/src/Service/SsoSettings/SsoSettingsSetService.php#L133-L169","documentation":"Thrown by SsoSettingsSetService::getSsoSettingsForm when the request payload has no 'provider' key. The service needs the provider name to select the matching settings validation form, so a missing provider is a bad request rejected before any validation runs.","triggerScenarios":"POST/PUT /sso/settings with a payload lacking the top-level 'provider' field (e.g. sending only the settings data object, or nesting provider inside data instead of alongside it).","commonSituations":"Client integrations sending the wrong payload shape; curl/scripts omitting the provider field; API changes between passbolt versions where payload structure moved.","solutions":["Add \"provider\": \"azure\" (or google/adfs/oauth2/pingone) to the request body.","Check the official API docs/swagger for the correct payload shape for your passbolt version.","Capture the exact request body in the client and diff against a known-good example."],"exampleFix":"// before\n{ \"data\": { \"url\": \"...\", \"client_id\": \"...\" } }\n// after\n{ \"provider\": \"azure\", \"data\": { \"url\": \"...\", \"client_id\": \"...\" } }","handlingStrategy":"validation","validationCode":"if (empty($payload['provider']) || !is_string($payload['provider'])) { throw new \\InvalidArgumentException('provider is required'); }","typeGuard":null,"tryCatchPattern":"try { $res = $api->setSsoSettings($payload); } catch (BadRequestException $e) { if ($e->getMessage() === 'Service provider missing.') { /* fix payload */ } throw $e; }","preventionTips":["Always include the provider field in SSO settings payloads.","Validate payloads against the API schema before sending.","Keep integration code updated with passbolt API changes."],"tags":["php","sso","bad-request","validation"],"backgroundTag":"missing-required-argument","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"}