aspose file tools
The moose likes JBoss and the fly likes JBoss 5.1.0 GA. FORM based authentication Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Products » JBoss
Reply Bookmark "JBoss 5.1.0 GA. FORM based authentication" Watch "JBoss 5.1.0 GA. FORM based authentication" New topic
Author

JBoss 5.1.0 GA. FORM based authentication

Jose Alvarez de Lara
Ranch Hand

Joined: May 10, 2008
Posts: 92
Hi,

I have been reading the post,

Failed to load users/passwords/role files

and I feel quite lost

I think that is the idea but I need it for a FORM based authentication.

This is the exception I get when I try to login,


06:44:10,343 ERROR [UsersRolesLoginModule] Failed to load users/passwords/role files
java.io.IOException: No properties file: users.properties or defaults: defaultUsers.properties found
at org.jboss.security.auth.spi.Util.loadProperties(Util.java:198)
at org.jboss.security.auth.spi.UsersRolesLoginModule.loadUsers(UsersRolesLoginModule.java:186)
at org.jboss.security.auth.spi.UsersRolesLoginModule.createUsers(UsersRolesLoginModule.java:200)
at org.jboss.security.auth.spi.UsersRolesLoginModule.initialize(UsersRolesLoginModule.java:127)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at javax.security.auth.login.LoginContext.invoke(LoginContext.java:756)
at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
at javax.security.auth.login.LoginContext.login(LoginContext.java:579)
at org.jboss.security.plugins.auth.JaasSecurityManagerBase.defaultLogin(JaasSecurityManagerBase.java:552)
at org.jboss.security.plugins.auth.JaasSecurityManagerBase.authenticate(JaasSecurityManagerBase.java:486)
at org.jboss.security.plugins.auth.JaasSecurityManagerBase.isValid(JaasSecurityManagerBase.java:365)
at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityManager.java:160)
at org.jboss.web.tomcat.security.JBossWebRealm.authenticate(JBossWebRealm.java:384)
at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:258)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:417)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)


My LoginModule is as follows,



As you can see I use validaUsuario() y recuperaRoles() to get the user and role against the database (Oracle)
but it seems this is not enough. Really I need som properties files they has to be in the classpath.

In my <jboss>\server\default\conf I have the following entry at login-config.xml,



being above what I guess I need and below of it my configuration.

How is it? Please help.

Best Regards,
Jose
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 8142
    
  52

What does your jboss-web.xml contain? And where have you configured your custom login module (MyLoginModule) in the login-config.xml (I don't see it in the content you posted).

[My Blog] [JavaRanch Journal]
Jose Alvarez de Lara
Ranch Hand

Joined: May 10, 2008
Posts: 92
Hello,

This is what I did.

I have placed in server/default/conf the config file dukesbank-jboss-beans.xml with content,



In the same folder server/default/conf I have placed the users.properties and roles.properties files
and I have got to get login but your questions make me wonder this is not the way.

I have no jboss-web.xml and my web app works ok.

How do I have to do?

Please, trace me the steps I have to follow and let me try it by myself.

Thanking in advance,
Jose
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: JBoss 5.1.0 GA. FORM based authentication
 
Similar Threads
EJB Security: Not getting correct name in Principal
Is this possible with JAAS, or WebSphere even for that matter?
Jboss login module issue, HTTP Status 403
Tomcat JAAS Authentication NullPointerException
java.lang.SecurityException: Authentication exception, principal=null