Setting Principal In Custom Login Module
I'm attempting to write a custom login module which extends javax.security.auth.spi.LoginModule
My module currently authenticates the user successfully, but the commit method which sets the principal does not appear to be working. To keep it simple, the method has the following body:
Principal p = new MyCustomPrincipal("testuser");
Commit is definitely being called, but my calls to request.getUserPrincipal() or request.getRemoteUser(), from a servlet are returning null.
I've also tried setting the principal within my server auth module (ServerAuthModule), but I get the same result.
Is there some other step or requirement I'm missing to set a custom principal when using a custom login module for glassfish (2.1.1)?