I'm using the RunAsLoginModule along with a custom login module that extends UsernamePasswordLoginModule. The RunAsLoginModule is working fine as I can see my role with SecurityAssociation.peekRunAsRole(). But when I call getUsername() it always returns null.
Here is my configuration...
<application-policy name="Hoot">
<login-module code="org.jboss.security.auth.spi.RunAsLoginModule" flag="required">
<module-option name="roleName">Login</module-option>
</login-module>
<login-module code = "org.bitwiser.hoot.security.EJBLoginModule" flag="required">
<!--<module-option name="password-stacking">useFirstPass</module-option>-->
</login-module>
</application-policy>
I have tried it both with and without the password-stacking option.
I can't do the authentication in my custom login module without knowing the username. How can I get it?
Does anyone have an example custom login module that uses RunAsLoginModule?
I'm using jboss 3.2.1.
You can't know the username until you execution gets method loadUserInfo or getRoleSets.