open-webui / open-webui

User-friendly WebUI for LLMs (Formerly Ollama WebUI)
https://openwebui.com
MIT License
38.68k stars 4.5k forks source link

feat: LDAP User management #668

Open this-josh opened 7 months ago

this-josh commented 7 months ago

Is your feature request related to a problem? Please describe. Users should be managed via LDAP, similar to Portainer

Describe the solution you'd like LDAP user management implemented

Describe alternatives you've considered

I believe LDAP is the best starting point

Additional context

One key feature of ollama-webui is its ability to have users, but without LDAP this doesn't have same network level utility.

jannikstdl commented 7 months ago

Yes agree, this would be a use case for us as well.

tjbck commented 7 months ago

Related: https://github.com/ollama-webui/ollama-webui/issues/483

SurvivaLlama commented 6 months ago

I can help test this.

eingemaischt commented 5 months ago

This would be great for us as well - an auth via Header, set by an reverse proxy, would be a great alternative. Then we could add different auth mechanisms (OpenID, LDAP, Kerberos etc) without implementing each of them in webui itself...

justinh-rahb commented 5 months ago

This would be great for us as well - an auth via Header, set by an reverse proxy, would be a great alternative. Then we could add different auth mechanisms (OpenID, LDAP, Kerberos etc) without implementing each of them in webui itself...

Excellent news, this has been implemented:

Manfredzimmermann commented 2 months ago

How can I connect Open-WebUI with Microsoft Active directory? I'm looking for an excellent solution. A fixed module in Open-WebUI for Active Directory (LDAP) would be a dream

FritzHeiden commented 1 month ago

I'd really like to see this feature implemented aswell

dorianborovina commented 1 month ago

Me too! +1 from me.

hostingnuggets commented 1 month ago

Me too! +100 from me ;-)

peske commented 1 month ago

+1

sry9681 commented 1 month ago

+1

lduplaga commented 3 weeks ago

Would be awesome to have this feature.

seal61 commented 1 week ago

+1

lduplaga commented 1 week ago

I solved my case with Microsoft authentication by this

https://docs.openwebui.com/tutorial/sso#microsoft

seal61 commented 1 week ago

I solved my case with Microsoft authentication by this

https://docs.openwebui.com/tutorial/sso#microsoft

does not help with local active directory / ldap server sadly, but might be useful for some.

WilsonZiweiWang commented 1 week ago

My implementation: https://github.com/WilsonZiweiWang/open-webui/commit/f4e487480f414f24ff19b0243e6357c0625b330f It worked in my case with my LDAP server. Feel free to play with it and leave a comment. Thanks.

hostingnuggets commented 1 week ago

Bravo @WilsonZiweiWang for your LDAP implementation. @tjbck could @WilsonZiweiWang's code be integrated to this project?

tjbck commented 1 week ago

Feel free to make a PR!

justinh-rahb commented 1 week ago

WilsonZiweiWang with some refac that might be workable for more servers. Not working on my AD server, but honestly I'm fairly sure it's either a layer8 problem, or we just need more environment variables to tune the (too many) options for LDAP binding, user search and field mappings.

Peter-De-Ath commented 1 week ago

My implementation: WilsonZiweiWang@f4e4874 It worked in my case with my LDAP server. Feel free to play with it and leave a comment. Thanks.

I wasn't quite able able to get this working out the box, but adding

LDAP_USER_DN = f'cn={cn},{LDAP_USERS_DN}'

inside if uid == form_data.user:

justinh-rahb commented 1 week ago

I got this to work with @Peter-De-Ath's modification on a test LDAP server, but still unable to get working on my (probably misconfigured by my predecessor) AD domain.

Some notes I'd add:

WilsonZiweiWang commented 1 week ago

hi all, thanks for testing my code and leaving comments, I have created the PR for this issue: https://github.com/open-webui/open-webui/pull/5056