Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Meenakshi Khatri
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Meenakshi Khatri
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic