Ensure that the credential object has "equals" and "hashCode" methods overriden such that you get object equality.
When i was writing this post - there was no overridings for equals and hashCode methods. Now they are and for me - it works. Thanks. But unfortunately there is new problem. My co-worker must login in with j_security_check servlet. There credential is password only.
So - I created cache specific for my login module. Now it works exactly as I expected.
Many thanks for answer.
I think I have a similar problem as your co-worker. I am using a j_security_check with a custom LoginModule that tries to connect to an Oracle database with the username and password provided. The thing is, that I am not able to access the password in a plaintext, which I need if I want to try to connect to the database.
Any suggestions? And if it has nothing to do with this thread, then I'm sorry :)