I forgot to mention I am using the JBoss 3.0.6 with Tomcat 4.1.18 bundle.
What do you mean "not sure to access j_username and j_password from my login.html"?? The web container is handling the form submit, you don't have to do anything there....
Thanks for your reply.
What I meant was - how can I access j_username and j_password from a custom login module?
I know that web container can authenticate for me but can I do that with a custom login module?
For this reason, I need to read the values of j_username and j_password in my login module.
Within your LoginModule there is a initialize-method which gets called.
There a callbackhandler is supplied which can be asked for Name and Password. You can use javax.security.auth.callback.NameCallback and PasswordCallback to get the info.
This info has to be used later when login gets called to verify the "correctness" of the supplied username and password. You could use the sharedState to store that information.
If the username/password is ok, set loginOk=true and return true from the login-method.
Implement a getPrincipal() method which returns the Identity of the User. Also implement the getRoleSet()-method to supply the associated roles.