• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)?
 
We've gotta get close enough to that helmet to pull the choke on it's engine and flood his mind! Or, we could just read this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic