User Management /Authentication
many of us often encounter the need to have a user management/authentication services.
if you're lucky, the users data is stored in an LDAP (unfortunately it's usually Active Directory).
if not, don't try to re-implement an LDAP. don't settle for short term vision. managing users/groups/passwords/policies is a major task that tends to grow during projects lifetime and eventually you spend a lot of time writing code that you shouldn't have.
instead, use OpenDS - a fully functional open source LDAP server from Sun.
it has all the features you need and a lot more, it's easy to manage(has a nice GUI), easy to extend schema, supports high availability and replication, costs nothing, and most important - you have your user data store up and running in minutes...
now in order to query and authenticate users use your favorite LDAP framework, I suggest novell's LDAP library.

Comments
I concur with Avi- having worked hand in hand with him for two of our clients using LDAP, I strongly suggest using OpenDS and the Novel libraries which are a charm to work with and will substantially decrease development life cycle. There is also place for mentionning OpenSSO.