aspose file tools*
The moose likes JBoss/WildFly and the fly likes JAAS login error: Failed to load users/passwords/role files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "JAAS login error: Failed to load users/passwords/role files" Watch "JAAS login error: Failed to load users/passwords/role files" New topic
Author

JAAS login error: Failed to load users/passwords/role files

Meenakshi Khatri
Greenhorn

Joined: Jun 12, 2007
Posts: 2
I am trying to implement JAAS and I get the following error:

ERROR [UsersRolesLoginModule] Failed to load users/passwords/role files
java.io.IOException: No properties file: users.properties or defaults: defaultUsers.properties found

Can someone tell me why this error happens? I have defined the application-policy in login-config.xml in JBoss. It points to the correct users.properties
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10210
    
166

Can you post the login-config.xml that you are using and also post the trace level logs of JBoss security package. You can get the logs by following the steps mentioned in Q4 at JBossSecurityFAQ


[My Blog] [JavaRanch Journal]
Meenakshi Khatri
Greenhorn

Joined: Jun 12, 2007
Posts: 2
As such, I was trying to create a JAAS implementation over Jboss's web-console page. I am using the existing entry of web-console in login-config.xml which is

<application-policy name = "web-console">
<authentication>
<login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
flag = "sufficient">
<module-option name="usersProperties">web-console-users.properties</module-option>
<module-option name="rolesProperties">web-console-roles.properties</module-option>
</login-module>
</authentication>
</application-policy>

The user anme & its role are being implemented in the web-console-users.properties & web-console-roles.properties files. The only changed that I made was that I changed the flag to "sufficient" so that I am able to use the LoginModule which I have made.
To be more precise, I got my own LoginModule class, & my main class extends httpServlet.

My jboss-web.xml file contains

<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<security-domain flushOnSessionInvalidation="false">java:/jaas/web-console</security-domain>
<context-root>/web-console</context-root>
</jboss-web>

This error appeared after I added jaas.config file in <project>/web-inf/jaas.config

myOwnLoginModule {
<path of my class file> required;
};

In my main servlet, I call it as

loginContext = new LoginContext("myOwnLoginModule ",new MyCallBackHandler());
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10210
    
166

So, you get an error while doing programatic JAAS login? Can you post the exception stacktrace and also the TRACE level logs from the JBoss security package (my earlier post has a link which tells how to do this)?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JAAS login error: Failed to load users/passwords/role files