{"record":{"id":"38080ece7e9386fe","repo":"Mintplex-Labs/anything-llm","slug":"simple-sso-is-not-enabled-it-must-be-enabled-to-v","errorCode":null,"errorMessage":"Simple SSO is not enabled. It must be enabled to validate or issue temporary auth tokens.","messagePattern":"Simple SSO is not enabled\\. It must be enabled to validate or issue temporary auth tokens\\.","errorType":"http","errorClass":null,"httpStatus":403,"severity":"error","filePath":"server/utils/middleware/simpleSSOEnabled.js","lineNumber":14,"sourceCode":"const { SystemSettings } = require(\"../../models/systemSettings\");\n\n/**\n * Checks if simple SSO is enabled for issuance of temporary auth tokens.\n * Note: This middleware must be called after `validApiKey`.\n * @param {import(\"express\").Request} request\n * @param {import(\"express\").Response} response\n * @param {import(\"express\").NextFunction} next\n * @returns {void}\n */\nasync function simpleSSOEnabled(_, response, next) {\n  if (!(\"SIMPLE_SSO_ENABLED\" in process.env)) {\n    return response\n      .status(403)\n      .send(\n        \"Simple SSO is not enabled. It must be enabled to validate or issue temporary auth tokens.\"\n      );\n  }\n\n  // If the multi-user mode response local is not set, we need to check if it's enabled.\n  if (!(\"multiUserMode\" in response.locals)) {\n    const multiUserMode = await SystemSettings.isMultiUserMode();\n    response.locals.multiUserMode = multiUserMode;\n  }\n\n  if (!response.locals.multiUserMode) {\n    return response\n      .status(403)\n      .send(\n        \"Multi-User mode is not enabled. It must be enabled to use Simple SSO.\"\n      );\n  }","sourceCodeStart":1,"sourceCodeEnd":32,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/utils/middleware/simpleSSOEnabled.js#L1-L32","documentation":"Feature guard in simpleSSOEnabled middleware: the SIMPLE_SSO_ENABLED environment variable is not present, so temporary-auth-token issuance/validation is unsupported on this instance and the middleware rejects with 403.","triggerScenarios":"Simple SSO validation or token issuance attempted while Simple SSO is disabled. Triggered when SSO endpoints are hit without the SSO feature enabled (simpleSSOEnabled.js:14).","commonSituations":"See trigger scenarios.","solutions":["Set the SIMPLE_SSO_ENABLED environment variable and restart the server.","Only call the Simple SSO token endpoints after Simple SSO has been configured."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}