# Not able to login on Latest with LDAP

**URL:** https://meta.discourse.org/t/not-able-to-login-on-latest-with-ldap/129282
**Category:** Support
**Created:** [September 23, 2019, 9:25am UTC](https://meta.discourse.org/t/not-able-to-login-on-latest-with-ldap/129282 "2019-09-23T09:25:21Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Iceman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iceman/32/181309_2.png) [@Iceman](https://meta.discourse.org/u/Iceman)
#### Post date: [September 23, 2019, 9:25am UTC](https://meta.discourse.org/t/not-able-to-login-on-latest-with-ldap/129282/1 "2019-09-23T09:25:21Z")

</div>

Hi guys,

Sorry to be bothering here with this issue, recently I updated our Discourse installation to latest. We are using the LDAP plugin ([GitHub - jonmbake/discourse-ldap-auth: Discourse plugin to enable LDAP/Active Directory authentication. · GitHub](https://github.com/jonmbake/discourse-ldap-auth.git)), however, users are unable to login.

If you kept your session you will experience no issue whatsoever. However, if you try to login now, when clicking on “Log In” the URL changes to: `/auth/failure?message=csrf_detected` and we get the error message: `Authorization timed out, or you have switched browsers. Please try again.`.

Does anyone know if there was a recent change that may lead into this situation?

Thanks.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [September 23, 2019, 9:51am UTC](https://meta.discourse.org/t/not-able-to-login-on-latest-with-ldap/129282/2 "2019-09-23T09:51:08Z")

</div>

I believe @david may have advice?

---

<div class="post-metadata">

### Author: ![Iceman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iceman/32/181309_2.png) [@Iceman](https://meta.discourse.org/u/Iceman)
#### Post date: [September 25, 2019, 10:09am UTC](https://meta.discourse.org/t/not-able-to-login-on-latest-with-ldap/129282/3 "2019-09-25T10:09:38Z")

</div>

A question on the side, is there a way to rollback to a previous version? Have been searching around and the consensus is to disable the plugins (or specific plugin at fault). However, I can’t disable this one because that’s the way that my users login into the platform 😛

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [September 25, 2019, 10:35am UTC](https://meta.discourse.org/t/not-able-to-login-on-latest-with-ldap/129282/4 "2019-09-25T10:35:16Z")

</div>

It’s not really supported, but If you have a backup you can delete the postgres data directory, put a commit in the version line in app.yml, rebuild, and restore the backup.

---

<div class="post-metadata">

### Author: ![Iceman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iceman/32/181309_2.png) [@Iceman](https://meta.discourse.org/u/Iceman)
#### Post date: [September 26, 2019, 1:04pm UTC](https://meta.discourse.org/t/not-able-to-login-on-latest-with-ldap/129282/5 "2019-09-26T13:04:35Z")

</div>

Yep, went for a backup and I’m trying to rebuild using the SHA of the version I had because it’s working iffy.

On the side I still have the latest-stable version trying to see if we can fix it somehow.

I don’t know if @david has any advice as suggested by @codinghorror but I’m willing to try anything since my userbase is locked out (unless they kept their session).

---

<div class="post-metadata">

### Author: ![Iceman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iceman/32/181309_2.png) [@Iceman](https://meta.discourse.org/u/Iceman)
#### Post date: [September 28, 2019, 8:40pm UTC](https://meta.discourse.org/t/not-able-to-login-on-latest-with-ldap/129282/6 "2019-09-28T20:40:31Z")

</div>

Quick update: Tried to use back up version with a snapshot of the machine as it was at that moment (before the upgrade). Clicking the “Log In” just reloads the main page twice. Tried to rebuild with the exact commit sha I had back then, not lucky, DB Rake error. 😶

Have been searching for other reports on the LDAP issue, doesn’t seem to be any. Can this be caused by an external soruce?

---

<div class="post-metadata">

### Author: ![Iceman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iceman/32/181309_2.png) [@Iceman](https://meta.discourse.org/u/Iceman)
#### Post date: [October 1, 2019, 2:54pm UTC](https://meta.discourse.org/t/not-able-to-login-on-latest-with-ldap/129282/7 "2019-10-01T14:54:58Z")

</div>

Last Update:

Issue solved, found the root cause, not discourse-related (sorry guys!). The issue was that the Certificate was updated and served through a HAP, we were not using a HAP before and Discourse was serving it itself, we forgot about this detail, which implied that we got that CORS error.

Lessons learned:

- Rolling back Discourse is not a thing, better have a backup of the entire machine (that was the case, thankfully).
- I’m yet to find out why it was so difficult to rebuild with a specific SHA following the instructions I read here, I was unable to do so.
- Better to always serve the certs from the HAP but don’t forget about it. (As a note for anyone else, it’s necessary to add the flag `'set-header X-Forwarded-Proto https'` because Discourse has its own NGINX, and this is where it was failing).
- The fact that no one was reporting the same issue (even considering that this is a corner-case since the plugin is not official) pointed to that direction (Community as intended 😛 )
- The issue only manifested late (to the point that we didn’t remember the Cert change) because of the rebuild triggered by the update, which is where it failed.

Once again, thanks and sorry for the noise!

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [October 31, 2019, 2:55pm UTC](https://meta.discourse.org/t/not-able-to-login-on-latest-with-ldap/129282/8 "2019-10-31T14:55:46Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
