LDAP Setup for Discourse

AI-generated summary

The discussion revolves around troubleshooting LDAP setup for Discourse. User pprp initially faced issues with the LDAP login option not appearing on the login page despite configuring the LDAP plugin and being able to authenticate via a direct URL. The issue was traced to a JavaScript error caused by a broken third-party plugin, which was resolved by removing the outdated “abbreviation” plugin. The user later encountered a similar issue after upgrading Discourse to v2.0.0.beta10 and changing the SSL certificate, with the LDAP button disappearing again. The community advised updating to a newer Discourse version (2.1.2) due to security concerns and compatibility issues with older plugins. A key point was the need to upgrade PostgreSQL to version 10+ for compatibility, especially when using an external database. The thread also touched on plugin conflicts, such as with omniauth-ldap, highlighting potential compatibility issues with newer Discourse versions. pprp, dnsmichi, Falco, and codinghorror contributed significantly to the resolution.

Hi,

I have followed and added almost every thing (LDAP plugin and LDAP configuration at /admin/site_settings/category/ldap) as per below links to set up LDAP for Discourse:

But I still can’t see LDAP option in login page UI.

Could you please let me know, if any other instructions need to follow.. ? to get the LDAP option in login page.

Thank you.

Hi,

I can directly access with “https://discourse-xxx.xxx/auth/ldap” for LDAP login, but I don’t see LDAP pop up after clicking on login button ( as shown in below screen shot).

Can any one please let me know if I will need to modify the Login form in the initial Discourse page to include an extra button that can allow me to redirect to “https://discourse-xxx.xx/auth/ldap”.

I have installed Discourse in Ubuntu Ubuntu 16.04.3 server and the Discourse version is v2.0.0.beta10

Did you disable local logins like shown here? This is what we use in a setup.

Hi, Thanks very much for the response.

When i disable local login (unchecked " enable local logins" option) and clicking on login button, and I got below blank pop up.

Did you enable the LDAP plugin and did the basic configuration?

Hi,

Thank you.

Yes, I have enabled the LDAP plugin and did the basic configuration, which is why I was able to do LDAP authentication with direct URL (“https://discourse-xxx.xxx/auth/ldap” )as mentioned in above posts.

Can you restart the docker container ( ./launcher restart app ) ?

Hi,

I did restart the docker container as suggested, but it still does not work.

Browser dev console has some errors or hints on the matter?

Hi, Thank you for the hint.

I checked by cliking F12 in google chrome, and it has below errors in home page:

Uncaught TypeError: Cannot read property ‘addPreProcessor’ of undefined
at _plugin-third-party-bbf5e2e3e7e7a22c7391a8d01a610ce18dd03367259d13426ed3751e26a14552.js:23
at _plugin-third-party-bbf5e2e3e7e7a22c7391a8d01a610ce18dd03367259d13426ed3751e26a14552.js:24

Which version of Discourse is installed?

Installed version:

v2.0.0.beta10 +230

So it looks like you are using a third-party plugin that is broken. And it’s not the LDAP one.

Can you try safe-mode ?

Hi,
I think we might have modify site_setting.yml to be able to see login with ldap button.
Do you know any idea?

We don’t have that in our setup. The JS error should be solved, that’s probably causing the page to not render properly.

@pprp
Please share the installed plugin lines from your app.yml and any modifications you’ve made to your theme with custom JS in the header, footer, etc. sections.

Plugins go here

see Install plugins on a self-hosted site for details

hooks:
after_code:
- exec:
cd: $home/plugins
cmd:
- git clone GitHub - discourse/docker_manager: Plugin for use with discourse docker image · GitHub
- git clone GitHub - discourse/discourse-solved: Allow accepted answers on topics · GitHub
- git clone GitHub - Jake-Shadle/discourse_jira: Discourse Onebox plugin for JIRA · GitHub
- git clone GitHub - PoloGT/abbreviation-discourse-plugin: A plugin for discourse to create abbreviation tags · GitHub
- git clone GitHub - jonmbake/discourse-ldap-auth: Discourse plugin to enable LDAP/Active Directory authentication. · GitHub
- git clone GitHub - ShaohuaSmile/discourse-jira: Automatically translate JIRA id to a hyperlink to JIRA issue · GitHub

where is files for " your theme with custom JS in the header, footer, etc. sections." ?

Not sure why you are answering instead of @pprp here, is that a colleague of yours?

yes I am his colleague.

I’d say you disable the jira and abbreviation plugins one by one and try to eliminate the error (each line removal with an app rebuild). Those plugins look dated, last commit was 2016. Not sure if they’re still compatible with Discourse, nor if they’re supported.

The abbreviation and jira onebox plugins for example were moved to #plugin:broken-plugin in 2016.

Theme customization happens in the frontend in your admin console, /admin/customize/themes. I doubt that this helps though as you’re using plugins which seem broken.