soudis / discoursesso

Nextcloud App providing Discourse SSO
GNU Affero General Public License v3.0
15 stars 5 forks source link

Get title from LDAP #21

Closed ClundXIII closed 3 years ago

ClundXIII commented 3 years ago

Hello,

do you think it would be possible to pass the title from an LDAP connection to Discourse?

soudis commented 3 years ago

Hi! Yes, I use that in my setup, but it is a littel messy. The workaround works like this:

First: In Nextcloud LDAP Settings under "Advanced" => "Directory Settings" => "2nd Username field" put in the LDAP attribute you want to use for a title

The the user display name in Nextcloud will be " ()", e.g. "John Doe (Title)"

Then: Configure the discoursesso plugin to extract the title for discourse from the nextcloud user name. It's a rather complicated looking regular expression: "/(([^)]*))/". Put this in the "Extract title" field for the discoursesso plugin configuration.

Please note that I use the German version of Nextcloud, so the englisch labels for the LDAP configuration fields may differ a littel bit.

Hope that works for you!

ClundXIII commented 3 years ago

Hi,

it works perfectly, thank you :)