简体   繁体   中英

LDAP user data caching on local database

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 user 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       |

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM