RocketChat/Rocket.Chat · error · Error

SAML Profile did not have the expected identifier (${userDat

Error message

SAML Profile did not have the expected identifier (${userDataMap.identifier.attribute}).

What it means

Error "SAML Profile did not have the expected identifier (${userDataMap.identifier.attribute})." thrown in RocketChat/Rocket.Chat.

Source

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

		switch (globalSettings.usernameNormalize) {
			case 'Lowercase':
				name = name.toLowerCase();
				break;
		}

		return name;
	}

	public static mapProfileToUserObject(profile: Record<string, any>): ISAMLUser {
		const userDataMap = this.getUserDataMapping();
		SAMLUtils.log({ msg: 'Mapping SAML Profile to User Object', userDataMap });

		if (userDataMap.identifier.type === 'custom') {
			if (!userDataMap.identifier.attribute) {
				throw new Error('SAML User Data Map: invalid Identifier configuration received.');
			}
			if (!profile[userDataMap.identifier.attribute]) {
				throw new Error(`SAML Profile did not have the expected identifier (${userDataMap.identifier.attribute}).`);
			}
		}

		const attributeList = new Map();
		for (const attributeName of userDataMap.attributeList) {
			if (profile[attributeName] === undefined) {
				this.log({ msg: 'SAML user profile is missing the attribute.', attribute: attributeName });
				continue;
			}
			attributeList.set(attributeName, profile[attributeName]);
		}
		const email = this.getProfileValue(profile, userDataMap.email);
		const profileUsername = this.getProfileValue(profile, userDataMap.username, true);
		const name = this.getProfileValue(profile, userDataMap.name, true);

		// Even if we're not using the email to identify the user, it is still mandatory because it's a mandatory information on Rocket.Chat
		if (!email) {
			throw new Error('SAML Profile did not contain an email address');

View on GitHub (pinned to 2a7de45707)

Solutions

  1. Ensure the IdP sends the attribute configured as the identifier in every SAML profile, or update the identifier mapping to an attribute the IdP provides.

When it happens

Trigger: Thrown when the SAML profile response does not include the attribute configured as the user identifier.

Common situations: See trigger scenarios.


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