How to store a file in LDAP?

隐身守侯 提交于 2019-12-23 05:02:41

问题


I'm looking for the best way to store a configuration file in an LDAP server. My application used to save the user settings in an xml file. The user logins have been centralized in an LDAP server. The users are stored as "inetOrgPerson" in the LDAP server. I would like to attach the xml file to each user.

What would be the best way to do it? Does a standard LDAP schema offer a class to store a text file? Or do I habe to extend the schema for my needs?


回答1:


Well, the best solution would probably be to save the configuration values directly in the LDAP schema. LDAP is ill suited to storing files or other large entries.

You can, of course, store the entire file either as a string or as binary data in the LDAP directory. But I suggest that you instead store the path to a network-accesible file, and use a proper network file system to store the actual file.




回答2:


It seems to me that this is pretty common, iNetOrgPerson entries have jpeg files for a image of the user. The syntax (jpegPhot entry) is 1.3.6.1.4.1.1466.115.121.1.25 There is also the binary syntax 1.3.6.1.4.1.1466.115.121.1.5 - Binary syntax which is used to hold most of the Certs (which are files)

You may want to just define your own schema with a file class, and use the binary syntax. That is what I am doing.

Cheers, Scott




回答3:


Sorry, you're picking the wrong server for your goals. Using an authentication & directory server for data storage makes about as much sense as using an email & calendat server for that purpose.

Furthermore, consider (nicking a Raymond Chen argument) what would happen if it was possible to store 1 file per user in an LDAP server. Now imagine we have two applications that try to save to that one file. So, the logical conclusion is that you can't have one file, but you would need a filesystem in LDAP.




回答4:


As far as I have seen, there are no standard LDAP schema to store a file. The best way would be to extend the schema. As long as you always use the same LDAP server and that you are allowed to configure it/them, it shouldn't be a problem. If you have different servers (OpenLDAP, ApacheDS, ...) you must learn how to do it for each server.



来源:https://stackoverflow.com/questions/746763/how-to-store-a-file-in-ldap

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!