{"record":{"id":"8117f60bcc5cea4a","repo":"RocketChat/Rocket.Chat","slug":"saml-user-map-invalid-regex","errorCode":null,"errorMessage":"SAML User Map: Invalid RegEx","messagePattern":"SAML User Map: Invalid RegEx","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/lib/saml/lib/Utils.ts","lineNumber":334,"sourceCode":"\t\t\t\t}\n\n\t\t\t\tconst fieldName = attribute.fieldName || attribute.fieldNames;\n\t\t\t\tconst { regex, template } = attribute;\n\n\t\t\t\tif (Array.isArray(fieldName)) {\n\t\t\t\t\tif (!fieldName.length) {\n\t\t\t\t\t\tthrow new Error(`SAML User Map: Invalid configuration for ${spFieldName} field.`);\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (const idpFieldName of fieldName) {\n\t\t\t\t\t\tparsedMap.attributeList.add(idpFieldName);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tparsedMap.attributeList.add(fieldName);\n\t\t\t\t}\n\n\t\t\t\tif (regex && typeof regex !== 'string') {\n\t\t\t\t\tthrow new Error('SAML User Map: Invalid RegEx');\n\t\t\t\t}\n\n\t\t\t\tif (template && typeof template !== 'string') {\n\t\t\t\t\tthrow new Error('SAML User Map: Invalid Template');\n\t\t\t\t}\n\n\t\t\t\tattributeMap = {\n\t\t\t\t\tfieldName,\n\t\t\t\t\t...(regex && { regex }),\n\t\t\t\t\t...(template && { template }),\n\t\t\t\t};\n\t\t\t} else if (typeof attribute === 'string') {\n\t\t\t\tattributeMap = {\n\t\t\t\t\tfieldName: attribute,\n\t\t\t\t};\n\t\t\t\tparsedMap.attributeList.add(attribute);\n\t\t\t}\n","sourceCodeStart":316,"sourceCodeEnd":352,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/2a7de457074cbb4d4373fbd9a4e5bea292c9c764/apps/meteor/server/lib/saml/lib/Utils.ts#L316-L352","documentation":"Error \"SAML User Map: Invalid RegEx\" thrown in RocketChat/Rocket.Chat.","triggerScenarios":"Thrown when a SAML user map regex override contains a regular expression that fails to compile.","commonSituations":"See trigger scenarios.","solutions":["Fix the regular expression in the SAML user data map entry so it compiles."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2a7de457074cbb4d4373fbd9a4e5bea292c9c764","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}