views:

471

answers:

3

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?

+2  A: 

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.

gnud
I know but I don't want to change so much in the application and I don't need to search the settings. That's why I would prefer to store the whole xml file.
Name
+2  A: 

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.

MSalters
I don't agree. I'm looking for a class to store a file, which means that one user can have several instance of the class so that several applications can store a file at the same time.
Name
Futhermore I think that a directory isn't a so bad place for personalization data, ie for storing user preferences.
Name
For posterity, I agree with MSalters that this is a bad idea. User preferences should be *properties* in an LDAP schema, but actually storing a file in an LDAP profile is clearly nonsense. However, storing paths to directories where user configuration details are stored (i.e. on network volumes), is a perfectly legitimate and very well established approach (and is how directory integration in the likes of Solaris and Mac OS X work).
Iain Collins
A: 

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.

Name