jonmbake / discourse-ldap-auth

Discourse plugin to enable LDAP/Active Directory authentication.
MIT License
70 stars 53 forks source link

ldap authentication not working after restoring backup in discourse #40

Open esepjav opened 5 years ago

esepjav commented 5 years ago

Hi, We have discourse production 1.9.0 with ldap plugin from https://github.com/jonmbake/discourse-ldap-auth.git commit ccf5e361943b2f50aa974f38ee4c757a6800213f (0.3.0). We restored data from production to our staging server which is 2.2.0 discourse version with recent ldap plugin (0.4.0). Unfortunately we are not able to authenticate with ldap even if ldap setting is same as before. Please support.

jonmbake commented 5 years ago

@esepjav Is there an error in the server log? If so, can you post it?

esepjav commented 5 years ago

where I can find ldap logs?

jonmbake commented 5 years ago

https://meta.discourse.org/t/where-are-all-the-discourse-logs/58022... If you can login with a non-ldap user, The logs web UI will probably display the error stack trace.

Otherwise, the next best place to check [on the server] is The Rails / Unicorn logs.

esepjav commented 5 years ago

We noticed that the table “user_emails” is empty for some users and they don’t show up in query “Active users”. Which action in discourse will add a record in this table?

jonmbake commented 5 years ago

That stores email addresses of users: https://github.com/discourse/discourse/blob/acd1693dac1bff6ff50250d942134bc48a27ff14/db/migrate/20170717084947_create_user_emails.rb. I believe email address is required so there should be at least one entry for each user.

esepjav commented 5 years ago

We found that "users" table when is imported to staging, "email" filed is not there any more and table "user_emails" doesn't have all data from production, so we want to write script to get all data from "users" table in production and compare with "user_emails" table and add missing one. do you have any comment?

esepjav commented 5 years ago

Also we found in discourse name has username info but we want to have real name for name. Is it possible?