{"record":{"id":"9b3840067e4d04ca","repo":"RocketChat/Rocket.Chat","slug":"saml-profile-did-not-have-the-expected-identifier","errorCode":null,"errorMessage":"SAML Profile did not have the expected identifier (${userDataMap.identifier.attribute}).","messagePattern":"SAML Profile did not have the expected identifier \\((.+?)\\)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/lib/saml/lib/Utils.ts","lineNumber":462,"sourceCode":"\t\tswitch (globalSettings.usernameNormalize) {\n\t\t\tcase 'Lowercase':\n\t\t\t\tname = name.toLowerCase();\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn name;\n\t}\n\n\tpublic static mapProfileToUserObject(profile: Record<string, any>): ISAMLUser {\n\t\tconst userDataMap = this.getUserDataMapping();\n\t\tSAMLUtils.log({ msg: 'Mapping SAML Profile to User Object', userDataMap });\n\n\t\tif (userDataMap.identifier.type === 'custom') {\n\t\t\tif (!userDataMap.identifier.attribute) {\n\t\t\t\tthrow new Error('SAML User Data Map: invalid Identifier configuration received.');\n\t\t\t}\n\t\t\tif (!profile[userDataMap.identifier.attribute]) {\n\t\t\t\tthrow new Error(`SAML Profile did not have the expected identifier (${userDataMap.identifier.attribute}).`);\n\t\t\t}\n\t\t}\n\n\t\tconst attributeList = new Map();\n\t\tfor (const attributeName of userDataMap.attributeList) {\n\t\t\tif (profile[attributeName] === undefined) {\n\t\t\t\tthis.log({ msg: 'SAML user profile is missing the attribute.', attribute: attributeName });\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tattributeList.set(attributeName, profile[attributeName]);\n\t\t}\n\t\tconst email = this.getProfileValue(profile, userDataMap.email);\n\t\tconst profileUsername = this.getProfileValue(profile, userDataMap.username, true);\n\t\tconst name = this.getProfileValue(profile, userDataMap.name, true);\n\n\t\t// 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\n\t\tif (!email) {\n\t\t\tthrow new Error('SAML Profile did not contain an email address');","sourceCodeStart":444,"sourceCodeEnd":480,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/2a7de457074cbb4d4373fbd9a4e5bea292c9c764/apps/meteor/server/lib/saml/lib/Utils.ts#L444-L480","documentation":"Error \"SAML Profile did not have the expected identifier (${userDataMap.identifier.attribute}).\" thrown in RocketChat/Rocket.Chat.","triggerScenarios":"Thrown when the SAML profile response does not include the attribute configured as the user identifier.","commonSituations":"See trigger scenarios.","solutions":["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."],"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"}