myuser table
username password
akila akila
sithum sithum
myuser_roles table
username role
akila admin
sithum guest
Then we have to edit login-config.xml in server/xxx/conf folder.
<application-policy name = "akila_policy">
<authentication>
<login-module code =
"org.jboss.security.auth.spi.DatabaseServerLoginModule" flag =
"required">
<module-option name =
"unauthenticatedIdentity">guest</module-option>
<module-option name =
"dsJndiName">java:/ifsds</module-option>
<module-option name = "principalsQuery">SELECT password
FROM myuser WHERE username=?</module-option>
<module-option name = "rolesQuery">SELECT role, 'Roles'
FROM myuser_roles WHERE username=?</module-option>
</login-module>
</authentication>
Remaining things are similar to Basic authentication login module as we discussed earlier. So click here find out about basic authentication login module.
No comments:
Post a Comment