-
Bug
-
Resolution: Won't Do
-
Major
-
JBossSecurity_2.0.2.GA
-
None
-
None
-
JBoss AS 4.2.2.GA
JaasSecurityManager.authenticate(String beanName, Principal principal, Object credential) has the following block:
try
{ // call login modules and authenticate } catch (Exception ex) {
ex.printStackTrace();
return false;
}
Disregarding the fact that "ex.printStackTrace()" is a definitely bad code style, swallowing all exceptions violates the JAAS specifications regarding the fact that login modules could return false or throw LoginException if login attempt has failed (see http://java.sun.com/j2se/1.5.0/docs/api/javax/security/auth/spi/LoginModule.html for details). This also affects Jboss SEAM framework which raises special event if LoginException has been thrown.
Observed behavior:
When LoginModule throws LoginException, JaasSecurityManager.authenticate() returns false without any additional checks.
Expected behavior:
When LoginModule throws LoginException, JaasSecurityManager should not catch (or should at least re-throw) it and allow the exception to reach the client code.