I'm building an LDAP authentication web application and I'm not too sure how to handle db user relationships (e.g. created, assigned, approvers, members)
So far I have come up with the following options:
the first time a user logs on to the system, check to see if the record exists among users. If not, do an ldap search to get the name and email and create a user record. The same thing happens when a user is added to a list or selected one. (possibly saving the last ldap search date and login details in x days)
create a user record using only cn and search on the fly for name and email
just save cn instead of fk and search on the fly for name and email.
I am inclined to move on to option 1, as this will simplify ORM and reduce the number of search queries ... on the other hand, it seems to be slightly reworked.
Any alternatives or reasons why the above options should be avoided will be appreciated.
source share