Hello!
   I am using JBoss 4.0.2 with the jbas-1875-patch.zip patch. I have a web 
application which uses a DatabaseLoginModule for authentication.
   I am having problems when one user changes its password. On the session bean 
I am executing the code at he end of this message to flush the Authentication 
Cache.
   
   After the user changes its password, any call to session beans throw the 
Exception:
"java.rmi.AccessException: SecurityException; nested exception is:
        javax.security.auth.login.FailedLoginException: Password 
Incorrect/Password Required"

    How can I solve this problem? Any help would really be appreciated.
    Thanks in advance,
          Victor Batista


//Code to flush Authentication Cache
        java.util.ArrayList servers = MBeanServerFactory.findMBeanServer(null);
        if (servers.size() != 1) {
            throw new EJBException("Not exactly one server found");
        }
        
        MBeanServer mbeanServer = (MBeanServer) servers.get(0);
        String[] params = { datasource };
        String[] signature = { "java.lang.String" };
        try {
            ObjectName name = new ObjectName("jboss.security", "service", 
"JaasSecurityManager");
            mbeanServer.invoke(name, "flushAuthenticationCache", params, 
signature);
            

            Principal user = sessionContext.getCallerPrincipal();
            char[] passwordChars = null; 

            if( passwd != null ) {
                passwordChars = passwd.toCharArray(); 
                SecurityAssociation.setPrincipal(user); 
                SecurityAssociation.setCredential(passwordChars); 
            }                 
            
        } catch (Exception e) {
            e.printStackTrace();
            throw new EJBException(e);
        }


View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3891463#3891463

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3891463


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to