{"record":{"id":"46963164106fdd4f","repo":"RocketChat/Rocket.Chat","slug":"saml-profile-did-not-contain-an-email-address","errorCode":null,"errorMessage":"SAML Profile did not contain an email address","messagePattern":"SAML Profile did not contain an email address","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/lib/saml/lib/Utils.ts","lineNumber":480,"sourceCode":"\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');\n\t\t}\n\n\t\tconst userObject: ISAMLUser = {\n\t\t\tsamlLogin: {\n\t\t\t\tprovider: this.relayState,\n\t\t\t\tidp: profile.issuer,\n\t\t\t\tidpSession: profile.sessionIndex,\n\t\t\t\tnameID: profile.nameID,\n\t\t\t},\n\t\t\temailList: ensureArray<string>(email),\n\t\t\tfullName: name || profile.displayName || profile.username,\n\t\t\teppn: profile.eppn,\n\t\t\tattributeList,\n\t\t\tidentifier: userDataMap.identifier,\n\t\t};\n\n\t\tif (profileUsername) {\n\t\t\tuserObject.username = this.normalizeUsername(profileUsername);","sourceCodeStart":462,"sourceCodeEnd":498,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/2a7de457074cbb4d4373fbd9a4e5bea292c9c764/apps/meteor/server/lib/saml/lib/Utils.ts#L462-L498","documentation":"Error \"SAML Profile did not contain an email address\" thrown in RocketChat/Rocket.Chat.","triggerScenarios":"Thrown when the SAML profile contains no email address and no email override can be derived.","commonSituations":"See trigger scenarios.","solutions":["Configure the IdP to include an email attribute in the SAML assertion, or map the email field to an attribute the IdP sends."],"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"}