开发者

LDAP user data caching on local database

开发者 https://www.devze.com 2023-01-03 09:47 出处:网络
I am integrating LDAP authentication in my web enterprise application. I would like to show listing of people name and email. Instead of querying the LDAP server for the name and email each time a lis

I am integrating LDAP authentication in my web enterprise application. I would like to show listing of people name and email. Instead of querying the LDAP server for the name and email each time a listing containing several users I thought about caching the data locally in the database.

Do you guys know about caching LDAP data best practices? Should I cache LDAP use开发者_JS百科r data? When should I insert and refresh the data?


I did the same thing when developping web applications with LDAP authentication.

Each time a user logs in, I retrieve his LDAP uid and checks if it is in the database. If not, I get user information from LDAP, in your case : name, surname (?) and email. Then insert it in the user table of the database.

The user table schema should look like this :

________________
| User         |
________________
| - id         |
| - ldap_uid   |
| - name       |
| - first_name |
| - mail       |
0

精彩评论

暂无评论...
验证码 换一张
取 消