Hi, The default queries for finding roles and permissions can be overwritten by configuration (in Shiro ini config):
jdbcRealm.authenticationQuery = SELECT password from users where username = ? and enabled = 1 jdbcRealm.userRolesQuery = select r.label from users_roles ur inner join roles r on ur.role_id = r.id where user_id = (select id from users where username = ?); jdbcRealm.permissionsQuery=select p.permission from roles_permissions rp inner join permissions p on rp.permission_id = p.id where rp.role_id = (select id from roles where label = ?); jdbcRealm.permissionsLookupEnabled=true You can change the tables/columns the way you need. Gr, Erik On 06/06/2014 12:11 PM, [email protected]<mailto:[email protected]> wrote: This issue is resolved. Problem was I defined the realm and datasource config below the [Users] section. After I move the definition to [main] section this error is gone. But I am facing another issue that Shiro seems to be using default security tables like users, users_roles etc. It's not allowing to use application specific tables Any idea how to resolve this issue? Thanks Ranganath Varma From: [email protected]<mailto:[email protected]> [mailto:[email protected]] Sent: Wednesday, June 04, 2014 4:55 PM To: [email protected]<mailto:[email protected]> Subject: JDBC Realm - Authentication failed Hi, I am trying to use Jdbc Realm for Shiro authentication and authorization in ISIS application. I have setup shiro.ini file as per given in the Configuration Shiro for JDBC documentation at: http://isis.apache.org/components/security/shiro/configuring-shiro.html I have tables created as required in shiro.ini. Even though om_users table has got sven as username and pass as password, on login Authentication Exception is thrown: PFA the Authentication.log BR Ranganath Varma The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com<http://www.wipro.com><http://www.wipro.com><http://www.wipro.com> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com<http://www.wipro.com>
