{"record":{"id":"3c398ecfa69dfa93","repo":"passbolt/passbolt_api","slug":"no-valid-sso-settings-found-ssoazureservice","errorCode":null,"errorMessage":"No valid SSO settings found.","messagePattern":"No valid SSO settings found\\.","errorType":"http","errorClass":"BadRequestException","httpStatus":400,"severity":"error","filePath":"plugins/PassboltEe/Sso/src/Service/Sso/Azure/SsoAzureService.php","lineNumber":120,"sourceCode":"            'emailClaim' => $data->email_claim ?? null,\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_AZURE) {\n                throw new BadRequestException('Invalid provider. Expected Azure as provider.');\n            }\n            if (!($ssoSettings->data instanceof SsoSettingsAzureDataDto)) {\n                throw new BadRequestException('Invalid provider data. Expected Azure 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    // OVERRIDDEN METHODS\n\n    /**\n     * @inheritDoc\n     */\n    public function assertResourceOwnerAgainstSsoState(\n        SsoResourceOwnerInterface $resourceOwner,\n        SsoState $ssoState\n    ): void {\n        parent::assertResourceOwnerAgainstSsoState($resourceOwner, $ssoState);\n\n        /** @var \\Passbolt\\Sso\\Utility\\Azure\\ResourceOwner\\AzureResourceOwner $resourceOwner */\n        $this->assertAuthTime($resourceOwner->getAuthTime(), $ssoState->created->getTimestamp());","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/plugins/PassboltEe/Sso/src/Service/Sso/Azure/SsoAzureService.php#L102-L138","documentation":"Azure's assertAndGetSsoSettings wraps getActiveOrFail and provider/data checks in a try/catch; any Exception (no active settings, or the provider/data assertion failures) is converted into BadRequestException 'No valid SSO settings found.' with the original exception chained.","triggerScenarios":"No activated Azure SSO settings exist, an SSO operation runs with only a draft, or the inner Azure provider/data assertions throw.","commonSituations":"Settings never activated; database reset removing sso_settings rows; wrong organization id; settings deleted mid-flow by another admin.","solutions":["Configure and fully activate Azure SSO settings in passbolt administration.","Use the dry-run flow to validate settings before activation.","Check logs/chained exception for the underlying cause (missing settings vs wrong provider).","Verify active sso_settings rows exist for your organization id."],"exampleFix":"// before\nAzure settings saved as draft only, then login attempted\n// after\nPOST /sso/settings/:id/activate (activate the draft) then retry SSO login","handlingStrategy":"try-catch","validationCode":"try {\n    (new SsoSettingsGetService())->getActiveOrFail();\n} catch (RecordNotFoundException $e) {\n    // no active settings: run the SSO setup wizard first\n}","typeGuard":null,"tryCatchPattern":"try {\n    $uac = $service->assertStateCodeAndGetUac(...);\n} catch (BadRequestException $e) {\n    if (str_contains($e->getMessage(), 'No valid SSO settings found')) {\n        // inspect $e->getPrevious() and activate Azure settings\n    }\n    throw $e;\n}","preventionTips":["Complete activation of Azure settings, not just the draft.","Backup/restore sso_settings along with the rest of the database.","Check previous-exception details in logs for root cause.","Use dry-run before activation."],"tags":["sso","azure","configuration","missing-settings"],"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"}