2016-09-14 188 views
0

我正在嘗試配置Apache Shiro以使用shiro.ini文件與Neo4j配合使用。配置Apache Shiro與Neo4j配合使用

這是我負責認證文件的shiro.ini部分:

... 
ds = org.apache.shiro.jndi.JndiObjectFactory 
ds.resourceName = java:comp/env/jdbc/Neo4jDb 
# What type do I set here 
ds.requiredType = 

jdbcRealm = org.apache.shiro.realm.jdbc.JdbcRealm 
jdbcRealm.permissionsLookupEnabled = true 
jdbcRealm.authenticationQuery = <Cypher Query> 
jdbcRealm.userRolesQuery = <Cypher Query> 
jdbcRealm.permissionsQuery = <Cypher Query> 
jdbcRealm.credentialsMatcher = $passwordMatcher 
jdbcRealm.dataSource=$ds 
securityManager.realms = $jdbcRealm 
... 

而且在我的context.xml

... 
<Resource auth="Container" driverClassName="org.neo4j" maxIdle="30" maxTotal="50" maxWaitMillis="10000" 
     name="jdbc/Neo4jDb" password="p4ssw0rd" type="" url="jdbc:neo4j:bolt://localhost/" username="neo4j"/> 

我的問題是,什麼類型做我四郎設置。 ini和context.xml < Resource ... type =「」... >

如果這不起作用,我對如何讓shiro工作的替代解決方案感興趣wi neo4j,如果neo4j具有良好的內置認證和授權,甚至更好,我願意將其用作解決方案。

回答