Closed kresnasatya closed 2 years ago
Hi @satyakresna,
Is it possible to use database auth strategy to cover that case. So, instead I load users from OpenLDAP, it will load from database?
Yes it's entirely possible, and if you're needing to view that many users on one page, I would definitely agree that sync'ing them to your local database would be a great option to keep your app feeling fast, since paginating that many users probably takes more than a couple seconds.
You don't actually need to use the LdapRecord-Laravel authentication driver to synchronize or import users. The sync functionality has been abstracted into it's own utility:
https://ldaprecord.com/docs/laravel/v2/importing
You could create an ldap_objects
database table to house these synchronized users, add a guid
and domain
database column, define sync attributes, and you're all set.
However, if you do need LDAP authentication into your application and/or need to attach data to those users as you would any Laravel application, it may make sense to configure the auth driver for this sync process.
Let me know if you have any further questions and I'd be happy to help 😄
Hi @stevebauman, thanks for your info. I will try and give feedback few days later.
Hi @stevebauman, In my OpenLDAP company we have more than 100k users. I want to load all users in a datatable using Livewire. So far, I use
select()
method to select which property of users that I want to load andpaginate()
method.Here's my code.
I also use spatie/laravel-collection-macros to convert Ldap Users to collection and set
paginate()
method from that package. Sometimes, all users load in datatable and sometimes the page is blank. Is it possible to use database auth strategy to cover that case. So, instead I load users from OpenLDAP, it will load from database? If yes, the next question is if I update or add users data and store it to database will LdapRecord provide like "sync" method? For authentication we use SSO with Keycloak platform and we use ldap federation to sync users and groups.Thanks.