{"record":{"id":"58f7eeb63bd52c09","repo":"passbolt/passbolt_api","slug":"no-valid-sso-settings-found-ssogoogleservice","errorCode":null,"errorMessage":"No valid SSO settings found.","messagePattern":"No valid SSO settings found\\.","errorType":"exception","errorClass":"BadRequestException","httpStatus":400,"severity":"error","filePath":"plugins/PassboltEe/Sso/src/Service/Sso/Google/SsoGoogleService.php","lineNumber":91,"sourceCode":"            'redirectUri' => Router::url('/sso/google/redirect', true),\n        ]);\n    }\n\n    /**\n     * @return \\Passbolt\\Sso\\Model\\Dto\\SsoSettingsDto\n     */\n    protected function assertAndGetSsoSettings(): SsoSettingsDto\n    {\n        try {\n            $ssoSettings = (new SsoSettingsGetService())->getActiveOrFail(true);\n            if ($ssoSettings->provider !== SsoSetting::PROVIDER_GOOGLE) {\n                throw new BadRequestException('Invalid provider. Expected Google as provider.');\n            }\n            if (!($ssoSettings->data instanceof SsoSettingsGoogleDataDto)) {\n                throw new BadRequestException('Invalid provider data. Expected Google settings.');\n            }\n        } catch (Exception $exception) {\n            throw new BadRequestException(__('No valid SSO settings found.'), 400, $exception);\n        }\n\n        return $ssoSettings;\n    }\n\n    // HELPERS\n}\n","sourceCodeStart":73,"sourceCodeEnd":99,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/plugins/PassboltEe/Sso/src/Service/Sso/Google/SsoGoogleService.php#L73-L99","documentation":"This is the catch-all in SsoGoogleService::assertAndGetSsoSettings: any exception during retrieval/validation of the active SSO settings (including RecordNotFoundException from getActiveOrFail and the provider/data BadRequestExceptions thrown inside the try) is rethrown as BadRequestException 'No valid SSO settings found.' with the original as previous.","triggerScenarios":"No SSO settings exist or none are active (getActiveOrFail throws); the settings are disabled/draft; or one of the provider/data checks above failed and got wrapped by this catch block.","commonSituations":"Fresh instance where SSO was never configured; SSO settings deleted or deactivated; admin saved settings but they remain in draft status; user attempting SSO login after admin removed the provider; settings saved for a different provider than the Google endpoint being hit.","solutions":["Verify SSO settings exist and are ACTIVE (not draft/deleted) via the admin SSO settings screen or SsoSettingsGetService","If Google SSO is intended, complete the settings setup/salvage flow so an active Google configuration exists","If another provider is configured, call that provider's SSO endpoint instead of Google's","Check the chained previous exception (3rd constructor arg) in logs to see whether it was not-found vs provider/data mismatch"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"try {\n    $settings = (new SsoSettingsGetService())->getActiveOrFail(true);\n    $hasValidGoogle = $settings->provider === SsoSetting::PROVIDER_GOOGLE\n        && $settings->data instanceof SsoSettingsGoogleDataDto;\n} catch (RecordNotFoundException $e) {\n    $hasValidGoogle = false;\n}","typeGuard":null,"tryCatchPattern":"try {\n    $settings = $googleService->assertAndGetSsoSettings();\n} catch (BadRequestException $e) {\n    $previous = $e->getPrevious();\n    // RecordNotFoundException => configure SSO; else provider/data mismatch\n}","preventionTips":["Ensure SSO settings are saved and ACTIVE (not draft) before users attempt SSO login","Log the chained previous exception to distinguish not-found from validation failures","Verify environment/database points to the instance holding SSO settings"],"tags":["sso","google","missing-settings","configuration"],"backgroundTag":"missing-config-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"}