OK. I admit it. After a week of trying to figure out how to check to see if an individual has permission to enter data into the DB I have no idea how to pull it off.
I have read and looked at many examples (each of which seems to be different) and tried to implement them. So far nothing works.
Is there anyone out there that can help me? Please??
At the bottom is the
Java code I am currently calling.
When this code is run 'theSubj' always comes back null.
I have a file in the db users with fields
username
passwd
Here is what I have in my mysql-service.xml. It is also currently in my login-config.xml.
[xml]
<application-policy name = "EJBSecurityDomain">
<authentication>
<login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule"
flag = "required">
<module-option name="dsJndiName">java:/MySqlDS</module-option>
<module-option name="principalsQuery">Select passwd from users where username = ?</module-option>
<!--
<module-option name="rolesQuery">Select userRoles from userroles where username=?</module-option>
-->
</login-module>
</authentication>
</application-policy>
[/xml]