The moose likes JBoss/WildFly and the fly likes authentication problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "authentication problem" Watch "authentication problem" New topic

authentication problem

Dima Shenkelbakh

Joined: Mar 27, 2009
Posts: 3
Hi guys,

I'm having some issues with JAAS authenticatin on jboss. We are still working for jboss-4.01.sp1 and I'm trying to deploy two application that would share user information through HttServletRequest's getRemoteUser() method. So I'm setting up a Realm across all apps deployed in our jboss. I created a sample web project to test authentication as a prerequisite, but it's not hitting the database. Here are the relevant files:




the databse is not getting hit and i know this from looking at the mysql query log. what did i miss?

thanks guys.
Peter Johnson

Joined: May 14, 2008
Posts: 5812

Try adding the following to WEB-INF/jboss-web.xml:

JBoss In Action
Dima Shenkelbakh

Joined: Mar 27, 2009
Posts: 3

I did make a jboss-web.xml with the same data. It didn't work. Database still wasn't being hit, the logs confirmed that. Any other ideas?
Dima Shenkelbakh

Joined: Mar 27, 2009
Posts: 3
i made some progress...now i get a different error message:

15:57:02,280 WARN [JAASRealm] Cannot find message associated with key jaasRealm
javax.security.auth.login.LoginException: Security Exception
at javax.security.auth.login.LoginContext.invoke(LoginContext.java:856)
at javax.security.auth.login.LoginContext.access$000(LoginContext.java:1
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:6
at javax.security.auth.login.LoginContext.login(LoginContext.java:579)
at org.apache.catalina.realm.JAASRealm.authenticate(JAASRealm.java:398)
at org.apache.catalina.realm.JAASRealm.authenticate(JAASRealm.java:322)
at org.apache.catalina.authenticator.FormAuthenticator.authenticate(Form
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.proce
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invok
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j

any ideas of what can be causing this? this is the same config as above, including jboss-web.xml in WEB-INF, but now in jboss-5.0.1. thanks.
Mauricio Rocha

Joined: Apr 23, 2008
Posts: 2
Hi, I'm getting the same error here... Did you find out how to make DatabaseServerLoginModule work? It's not even hitting the db...
Peter Johnson

Joined: May 14, 2008
Posts: 5812

Maurico, it would have been better if you started a new topic. It also helps if you provide the details.. Post the login module from login-config.xml, the *-ds.xml file for the database, the jboss-web.xml file and sections of the web.xml file that deal with access control.

Don't forget the use the 'code' tags when posting the source code, especially the XML text. Select the text and click the Code button above the text editor window.
subject: authentication problem
Similar Threads
Adding users and roles
About the security and role in web.xml
req.isUserInRole("admin"); return false??
Problems with FORM Authentication