{"record":{"id":"efd003f51843a3ec","repo":"RocketChat/Rocket.Chat","slug":"saml-user-map-invalid-template","errorCode":null,"errorMessage":"SAML User Map: Invalid Template","messagePattern":"SAML User Map: Invalid Template","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/lib/saml/lib/Utils.ts","lineNumber":338,"sourceCode":"\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\n\t\t\tif (attributeMap) {\n\t\t\t\tif (spFieldName === 'email' || spFieldName === 'username' || spFieldName === 'name') {\n\t\t\t\t\tparsedMap[spFieldName] = attributeMap;\n\t\t\t\t}","sourceCodeStart":320,"sourceCodeEnd":356,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/2a7de457074cbb4d4373fbd9a4e5bea292c9c764/apps/meteor/server/lib/saml/lib/Utils.ts#L320-L356","documentation":"Error \"SAML User Map: Invalid Template\" thrown in RocketChat/Rocket.Chat.","triggerScenarios":"Thrown when a SAML user map template override contains an invalid template string.","commonSituations":"See trigger scenarios.","solutions":["Fix the template string in the SAML user data map entry; use the supported template syntax (e.g. __attribute__ placeholders)."],"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-14T00:17:10.932Z"}