Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement LDAP SYNC button to update users by LDAP_Unique_Identifier_Field #2262

Closed
matlj opened this issue Feb 17, 2016 · 8 comments
Closed

Comments

@matlj
Copy link

matlj commented Feb 17, 2016

We just upgraded our docker image to 0.18.0 and our users cannot login anymore (openldap binding). We tried to use the new default domain search instead of our custom query that was working in 0.17 but with the same result.
On the other hand, using a LDAP account that never logged in is successful. It seems it can't map the ldap user to the internal existing user (except for new users).

LDAPHandler ➔ info Init login joe
LDAP ➔ connection_info Init setup
LDAP ➔ connection_info Connecting ldap://ldap.xxx.xxx:389
LDAP ➔ connection_debug connectionOptions { url: 'ldap://ldap.xxx.xxx:389',
  timeout: 5000,
  connectTimeout: 10000,
  idleTimeout: 10000,
  reconnect: false }
LDAP ➔ connection_info LDAP connected
LDAP ➔ bind_info Binding admin user cn=rocketservice,ou=People,dc=xxx,dc=xxx
LDAP ➔ search_info Searching user joe
LDAP ➔ search_debug searchOptions { filter: '(&(objectclass=inetOrgPerson)(|(cn=joe)(mail=joe)))',
  scope: 'sub' }
LDAP ➔ search_debug domain_base ou=people,dc=xxx,dc=xxx
LDAP ➔ search_info Search result count 1
LDAP ➔ search_debug Search result [ { messageID: 2,
    protocolOp: 100,
    controls: [],
    log: 
     { domain: null,
       _events: {},
       _maxListeners: 10,
       _isSimpleChild: true,
       _level: 30,
       streams: [Object],
       serializers: [Object],
       src: false,
       fields: [Object] },
    id: [Getter],
    dn: [Getter],
    type: [Getter],
    json: [Getter],
    objectName: 'cn=joe,ou=People,dc=xxx,dc=xxx',
    attributes: 
     [ [Object],
       [Object],
       [Object],
       [Object],
       [Object],
       [Object],
       [Object],
       [Object] ],
    object: [Getter],
    raw: [Getter],
    _dn: [Getter],
    connection: 
     { _connecting: false,
       _handle: [Object],
       _readableState: [Object],
       readable: true,
       domain: null,
       _events: [Object],
       _maxListeners: 10,
       _writableState: [Object],
       writable: true,
       allowHalfOpen: false,
       onend: null,
       destroyed: false,
       bytesRead: 302,
       _bytesDispatched: 193,
       _pendingData: null,
       _pendingEncoding: '',
       pipe: [Function],
       addListener: [Function: addListener],
       on: [Function: addListener],
       pause: [Function],
       resume: [Function],
       read: [Function],
       _consuming: true } } ]
LDAP ➔ auth_info Authenticating cn=joe,ou=People,dc=xxx,dc=xxx
LDAP ➔ auth_info Authenticated cn=joe,ou=People,dc=xxx,dc=xxx
LDAP ➔ connection_info Disconecting
LDAPHandler ➔ info Querying user
LDAPHandler ➔ debug userQuery { 'services.ldap.id': '6d61747468696575' }
LDAPHandler ➔ info User does not exists, creating
@sampaiodiego
Copy link
Member

can you please see in the database if there is any visible difference between the new and the old users?
I mean, in the rocketchat database.. users collection.. 😉

@matlj
Copy link
Author

matlj commented Feb 17, 2016

Problem is... I don't know how to access the mongo database directly. The DB is running in a docker container :
91c6f6e14e69 mongo "/entrypoint.sh mongo" 4 weeks ago Up 3 weeks 27017/tcp rocketchatdevelop_mongo_1

but I can't connect to TCP port 27017 and the mongodump command returns : couldn't connect to [127.0.0.1] couldn't connect to server 127.0.0.1

@matlj
Copy link
Author

matlj commented Feb 17, 2016

Nevermind, I found the data and managed to export it. Indeed, there is a db field on a new user that is missing in all our existing users (ldap ID) :
ldap^@^^@^@^@^Bid^@^O^@^@^@6c617572656e74

The only field with "ldap" on existing users is "ldap name", like this one : ldap^@^A^Bname^@^O^@^@^@joe

@sampaiodiego
Copy link
Member

@rodrigok are we setting the services.ldap.id field now but not setting it before?

@engelgabriel
Copy link
Member

@rodrigok was there a migration step for this?

@engelgabriel engelgabriel added this to the 0.19.0 milestone Feb 17, 2016
@rodrigok
Copy link
Member

Leaving the LDAP_Unique_Identifier_Field empty in settings will keep users loging via username.

@matlj
Copy link
Author

matlj commented Feb 17, 2016

That worked !! Thank you very much

@engelgabriel engelgabriel changed the title No LDAP login after 0.18 upgrade Implement LDAP SYNC button to update users by LDAP_Unique_Identifier_Field Feb 17, 2016
@engelgabriel
Copy link
Member

Ok, thanks @matlj leave this issue open as we will use it to track the implementation of the button that will sync LDAP_Unique_Identifier_Field, and add to the users that dont have it yet too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants