-
1. Re: change password without reloggin
cathylee Sep 8, 2003 11:01 AM (in response to cathylee)I have this problem with JBoss 3.2.1.
I use roles.properties and users.properties, the following code executed without error, but the old password is still in force afterward.
Also I want to copy the two properties files to my destination dir, and update them every time password is changed, so that I can copy these up-to-date password files back when application upgrade(everytime a newer version is deployed). Have any idea how to do that?
Thanks!
SecurityAssociation.setCredential(newPSW);
java.util.ArrayList servers = MBeanServerFactory.findMBeanServer(null);
if (servers.size() != 1)
System.err.println("No server found");
MBeanServer server = (MBeanServer) servers.get(0);
try {
String jaasMgrName = "jboss.security:service=JaasSecurityManager";
ObjectName jaasMgr = new ObjectName(jaasMgrName);
Object[] params = {"myDomainName", new org.jboss.security.SimplePrincipal("myUserName")};
String[] signature = {"java.lang.String","java.security.Principal"};
server.invoke(jaasMgr, "flushAuthenticationCache", params, signature);
} catch (Exception e) {
System.err.println("flushSecurityDomain Except: " + e);
} -
2. Re: change password without reloggin
pgmjsd Sep 8, 2003 4:46 PM (in response to cathylee)cathylee,
It might be better to use a database to store the usernames an passwords if the passwords are going to be changed. Try the DatabaseServerLoginModule instead. Or, if you don't mind LDAP, use the LDAP login module. -
3. Re: change password without reloggin
cathylee Sep 10, 2003 12:23 PM (in response to cathylee)If I use database I have to have a JDBC accessible database running, and config it talk to JBoss, right?
-
4. Re: change password without reloggin
pgmjsd Sep 11, 2003 5:27 AM (in response to cathylee)> If I use database I have to have a JDBC accessible
> database running, and config it talk to JBoss, right?
Yes. You will need to have a DataSource defined. The 'DefaultDS' DataSource can be used, you need to create the tables and add some rows, of course.