RocketChat / RocketChat/Rocket.Chat
LDAP multiple email parsing error
Open
Nobody has claimed this yet.
area: authentication
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Description:
LDAP entries of user with multiple email addresses fail to parse rendering them unable to login.
Steps to reproduce:
Try to login or sync data of a user with multiple email LDAP entries.
Expected behavior:
The first email that has been found should be used as the users email address.
Actual behavior:
Login and data sync fails for users with multiple email addresses.
Server Setup Information:
- Version of Rocket.Chat Server: 1.1.1
- Operating System: Centos 7
- Deployment Method: docker-compose
- Number of Running Instances: 1
- DB Replicaset Oplog: Enabled
- NodeJS Version: 8.11.4
- MongoDB Version: 4.0.10
Additional context
This is similar to a previous issue #2642 that has supposedly been fixed. I'm using FreeIPA as the LDAP provider.
Relevant logs:
server.js:207 LDAPSync ➔ error Error creating user { Error: Match error: Expected string, got object in field email
at check (packages/check/match.js:36:17)
at createUser (packages/accounts-password/password_server.js:1052:3)
at AccountsServer.Accounts.createUser (packages/accounts-password/password_server.js:1147:10)
at addLdapUser (app/ldap/server/sync.js:264:29)
at MethodInvocation.<anonymous> (app/ldap/server/loginHandler.js:150:17)
at tryLoginMethod (packages/accounts-base/accounts_server.js:460:31)
at tryLoginMethod (packages/accounts-base/accounts_server.js:1294:14)
at AccountsServer._runLoginHandlers (packages/accounts-base/accounts_server.js:458:22)
at AccountsServer.Accounts._runLoginHandlers (app/lib/server/lib/loginErrorMessageOverride.js:7:35)
at MethodInvocation.methods.login (packages/accounts-base/accounts_server.js:518:31)
at MethodInvocation.methodMap.(anonymous function) (packages/rocketchat_monitoring.js:2731:30)
at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1767:12)
at DDP._CurrentMethodInvocation.withValue (packages/ddp-server/livedata_server.js:719:19)
at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1304:12)
at DDPServer._CurrentWriteFence.withValue (packages/ddp-server/livedata_server.js:717:46)
at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1304:12)
at Promise (packages/ddp-server/livedata_server.js:715:46)
at new Promise (<anonymous>)
at Session.method (packages/ddp-server/livedata_server.js:689:23)
at packages/ddp-server/livedata_server.js:559:43
message: 'Match error: Expected string, got object in field email',
path: 'email',
sanitizedError:
{ Error: Match failed [400]
at errorClass.<anonymous> (packages/check/match.js:91:27)
at new errorClass (packages/meteor.js:725:17)
at check (packages/check/match.js:36:17)
at createUser (packages/accounts-password/password_server.js:1052:3)
at AccountsServer.Accounts.createUser (packages/accounts-password/password_server.js:1147:10)
at addLdapUser (app/ldap/server/sync.js:264:29)
at MethodInvocation.<anonymous> (app/ldap/server/loginHandler.js:150:17)
at tryLoginMethod (packages/accounts-base/accounts_server.js:460:31)
at tryLoginMethod (packages/accounts-base/accounts_server.js:1294:14)
at AccountsServer._runLoginHandlers (packages/accounts-base/accounts_server.js:458:22)
at AccountsServer.Accounts._runLoginHandlers (app/lib/server/lib/loginErrorMessageOverride.js:7:35)
at MethodInvocation.methods.login (packages/accounts-base/accounts_server.js:518:31)
at MethodInvocation.methodMap.(anonymous function) (packages/rocketchat_monitoring.js:2731:30)
at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1767:12)
at DDP._CurrentMethodInvocation.withValue (packages/ddp-server/livedata_server.js:719:19)
at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1304:12)
at DDPServer._CurrentWriteFence.withValue (packages/ddp-server/livedata_server.js:717:46)
at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1304:12)
at Promise (packages/ddp-server/livedata_server.js:715:46)
at new Promise (<anonymous>)
at Session.method (packages/ddp-server/livedata_server.js:689:23)
at packages/ddp-server/livedata_server.js:559:43
isClientSafe: true,
error: 400,
reason: 'Match failed',
details: undefined,
message: 'Match failed [400]',
errorType: 'Meteor.Error' },
errorType: 'Match.Error' }
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.