I authenticate my application using DatabaseServerLoginMudule. My session remote bean calls the LoginContext.login() method in "Authenticator" session local bean. The authentication process seems going good but when I call the getSessionContext().getCallerPrincipal() method from the remote session bean I get this message:
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
javax.transaction.TransactionRolledbackException: No security context set; CausedByException is:
No security context set; nested exception is:
java.lang.IllegalStateException: No security context set
I use Jboss-3.0.1 and my login-config.xml file is configured in this way:
cy>
<application-policy name = "LoginRealm">
<login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule" flag = "required">
<module-option name="dsJndiName">java:/OracleDS</module-option>
<module-option name="principalsQuery"> select PASSWORD from APPUSER where USERNAME=?</module-option>
<module-option name="rolesQuery"> select ROLE.NAME, 'ROLES' from ROLE, ROLEDSUBJECT, BUSSUBJECT, APPUSER where APPUSER.BUSINESSSUBJECT = BUSSUBJECT.ID and BUSSUBJECT.ID = ROLEDSUBJECT.BUSINESSSUBJECT and ROLEDSUBJECT.ROLE = ROLE.ID and USERNAME=?</module-option>
</login-module>
</application-policy>
Please help me, tell me if I should configure some other files!
thank you.
Luca