Read the JAAS howto in this forum.
I read the JAAS howto that you suggested. That helped quite a bit. However, I am having trouble with JNDI. When the login method is called from my standalone client app, I get the following exception:
javax.naming.NameNotFoundException: DefaultDS not bound
I am using the example server_auth.conf in the example code from the HOWTO.
You should be using the auth.conf on the client as the examples do.