RocketChat/Rocket.Chat · error · Error

SAML User Map: Invalid Template

Error message

SAML User Map: Invalid Template

What it means

Error "SAML User Map: Invalid Template" thrown in RocketChat/Rocket.Chat.

Source

Thrown at apps/meteor/server/lib/saml/lib/Utils.ts:338

				if (Array.isArray(fieldName)) {
					if (!fieldName.length) {
						throw new Error(`SAML User Map: Invalid configuration for ${spFieldName} field.`);
					}

					for (const idpFieldName of fieldName) {
						parsedMap.attributeList.add(idpFieldName);
					}
				} else {
					parsedMap.attributeList.add(fieldName);
				}

				if (regex && typeof regex !== 'string') {
					throw new Error('SAML User Map: Invalid RegEx');
				}

				if (template && typeof template !== 'string') {
					throw new Error('SAML User Map: Invalid Template');
				}

				attributeMap = {
					fieldName,
					...(regex && { regex }),
					...(template && { template }),
				};
			} else if (typeof attribute === 'string') {
				attributeMap = {
					fieldName: attribute,
				};
				parsedMap.attributeList.add(attribute);
			}

			if (attributeMap) {
				if (spFieldName === 'email' || spFieldName === 'username' || spFieldName === 'name') {
					parsedMap[spFieldName] = attributeMap;
				}

View on GitHub (pinned to 2a7de45707)

Solutions

  1. Fix the template string in the SAML user data map entry; use the supported template syntax (e.g. __attribute__ placeholders).

When it happens

Trigger: Thrown when a SAML user map template override contains an invalid template string.

Common situations: See trigger scenarios.


AI-assisted analysis of RocketChat/Rocket.Chat@2a7de45707 (2026-08-18). Data as JSON: /api/errors/efd003f51843a3ec. Report an issue: GitHub.