This is very basic and can be expanded upon quite a bit. Fortunately if you need a more detailed example AD seems to be the most common form of LDAP people are using with Openfire. A quick google search turns up lots of examples with much more detail than I can provide.