How to configure JDBCRealm to obtain its DataSource from JNDI

后端 未结 4 1159
猫巷女王i
猫巷女王i 2021-02-04 05:31

How do you use a JDBCRealm to handle authenticating and authorizing users in servlets? The only example I can find is to create the DataSource in web.xml

4条回答
  •  佛祖请我去吃肉
    2021-02-04 06:06

    For Shiro to work with permissions with the JDBC realm this parameter is indispensable:

    jdbcRealm.permissionsLookupEnabled = true 
    

    I wasted many hours on this because the default for this option is false. In other words, if you don't put this option Shiro always return an empty list of permissions.

提交回复
热议问题