美文网首页
问题解决org.neo4j.driver.exceptions.

问题解决org.neo4j.driver.exceptions.

作者: 勤的空间 | 来源:发表于2020-10-31 13:52 被阅读0次

    最近使用springdata neo4j连接neo4j时报错org.neo4j.driver.exceptions.AuthenticationException: Unsupported authentication token, scheme='none' only allowed when auth is disabled
    网上有说法让改neo4j配置文件neo4j.confdbms.security.auth_enabled=true这一句改成false,试了确实可行,但这样就是连接数据库不需要用户名和密码了,这很不安全,官方不建议这么做。
    那么是哪里出了问题呢?后来发现是自己application.properties的问题,springdata neo4j的官方文档的写法是错误的:

    org.neo4j.driver.uri=bolt://localhost:7687
    org.neo4j.driver.authentication.username=neo4j
    org.neo4j.driver.authentication.password=password
    

    改成如下才可以通过用户名和密码连接:

    spring.data.neo4j.uri=bolt://localhost:7687
    spring.data.neo4j.username=neo4j
    spring.data.neo4j.password=password
    

    相关文章

      网友评论

          本文标题:问题解决org.neo4j.driver.exceptions.

          本文链接:https://www.haomeiwen.com/subject/beysvktx.html