刚刚从2.1升级到2.2..系统提示您将密码添加到neo4j。是不是..。图形看起来很好..但是现在我的rails应用程序,它使用了新的Gem,将不能连接。
我得到了这个错误:
UsersController#try_login中的未授权错误
我已将代码更改为
@neo = Neography::Rest.new("http://neo4j:neo4j!@localhost:7474")但它不起作用。
已将初始化文件更改为
Neography.configure do |config|
config.protocol = "http://"
config.server = "localhost"
config.port = 7474
config.directory = "" # prefix this path with '/'
config.cypher_path = "/cypher"
config.gremlin_path = "/ext/GremlinPlugin/graphdb/execute_script"
config.log_file = "neography.log"
config.log_enabled = false
config.max_threads = 20
config.authentication = nil # nil 'basic' or 'digest'
config.username = "neo4j"
config.password = "neo4j!"
config.parser = MultiJsonParser
end这也不起作用(不用担心密码被更改了)
以前我从来没有在Neo上使用过密码,但在这个新版本中,我使用了密码,现在我的应用程序无法连接。我没有安装任何证书,并且正在使用任何形式的身份验证。
我可以在登录后使用正确的密码连接到web管理员,但我无法通过我的应用程序成功连接。
有什么我没注意到的吗?我需要安装证书吗?在OS 10.7.5、Rails 3.2.11、Ruby ruby 1.9.3p429、webrick和Neography Gem上工作。
更新:我是从rails控制台运行的:
@neo = Neography::Rest.new("http://neo4j:neo4j@localhost:7474")然后回来了
=> #<Neography::Rest:0x007fe04a8ff9d0 @connection=#<Neography::Connection:0x007fe04a8ff7f0 @protocol="http://", @server="localhost", @port=7474, @directory="", @cypher_path="/cypher", @gremlin_path="/ext/GremlinPlugin/graphdb/execute_script", @log_file="neography.log", @log_enabled=false, @max_threads=20, @parser=MultiJsonParser, @user_agent={"User-Agent"=>"Neography/1.0.9"}, @authentication={:basic_auth=>{:username=>"neo4j", :password=>"neo4j"}}, @client=#<HTTPClient:0x007fe04a906640 @proxy=nil, @no_proxy=nil, @no_proxy_regexps=[], @www_auth=#<HTTPClient::WWWAuth:0x007fe04a906438 @basic_auth=#<HTTPClient::BasicAuth:0x007fe04a906410 @cred=nil, @set=false, @auth={}, @challengeable={}, @scheme="Basic">, @digest_auth=#<HTTPClient::DigestAuth:0x007fe04a906118 @auth={}, @challenge={}, @set=false, @nonce_count=0, @scheme="Digest">, @negotiate_auth=#<HTTPClient::NegotiateAuth:0x007fe04a906050 @auth={}, @auth_default=nil, @challenge={}, @scheme="Negotiate", @set=false, @ntlm_opt={:ntlmv2=>true}>, @ntlm_auth=#<HTTPClient::NegotiateAuth:0x007fe04a905f38 @auth={}, @auth_default=nil, @challenge={}, @scheme="NTLM", @set=false, @ntlm_opt={:ntlmv2=>true}>, @sspi_negotiate_auth=#<HTTPClient::SSPINegotiateAuth:0x007fe04a905e48 @challenge={}, @scheme="Negotiate">, @oauth=#<HTTPClient::OAuth:0x007fe04a905d80 @config=nil, @auth={}, @challengeable={}, @nonce_count=0, @signature_handler={"HMAC-SHA1"=>#<Method: HTTPClient::OAuth#sign_hmac_sha1>}, @scheme="OAuth">, @authenticator=[#<HTTPClient::OAuth:0x007fe04a905d80 @config=nil, @auth={}, @challengeable={}然后我尝试创建一个节点:
@neo.create_node并接收到
Neography::UnauthorizedError: from /Volumes/Data/BlueFrog/BigData/n2/neograph/vendor/bundle/bundler/gems/neography-589bd7b680ac/lib/neography/connection.rb:181:in `handle_4xx_500_response'
from /Volumes/Data/BlueFrog/BigData/n2/neograph/vendor/bundle/bundler/gems/neography-589bd7b680ac/lib/neography/connection.rb:143:in `return_result'
from /Volumes/Data/BlueFrog/BigData/n2/neograph/vendor/bundle/bundler/gems/neography-589bd7b680ac/lib/neography/connection.rb:126:in `evaluate_response'
from /Volumes/Data/BlueFrog/BigData/n2/neograph/vendor/bundle/bundler/gems/neography-589bd7b680ac/lib/neography/connection.rb:45:in `post'
from /Volumes/Data/BlueFrog/BigData/n2/neograph/vendor/bundle/bundler/gems/neography-589bd7b680ac/lib/neography/rest/nodes.rb:48:in `create_empty'
from /Volumes/Data/BlueFrog/BigData/n2/neograph/vendor/bundle/bundler/gems/neography-589bd7b680ac/lib/neography/rest/nodes.rb:35:in `create'
from /Volumes/Data/BlueFrog/BigData/n2/neograph/vendor/bundle/bundler/gems/neography-589bd7b680ac/lib/neography/rest.rb:81:in `create_node'
from (irb):2
from /Volumes/Data/BlueFrog/BigData/n2/neograph/vendor/bundle/gems/railties-3.2.11/lib/rails/commands/console.rb:47:in `start'
from /Volumes/Data/BlueFrog/BigData/n2/neograph/vendor/bundle/gems/railties-3.2.11/lib/rails/commands/console.rb:8:in `start'
from /Volumes/Data/BlueFrog/BigData/n2/neograph/vendor/bundle/gems/railties-3.2.11/lib/rails/commands.rb:41:in `<top (required)>'发布于 2015-03-26 11:02:46
很奇怪..。这对我很有效。
2.2.0 :003 > @neo = Neography::Rest.new("http://neo4j:swordfish@localhost:7474")
@neo.create_node
{"extensions"=>{}, "outgoing_relationships"=>"http://localhost:7474/db/data/node/0/relationships/out", "labels"=>"http://localhost:7474/db/data/node/0/labels", "traverse"=>"http://localhost:7474/db/data/node/0/traverse/{returnType}", "all_typed_relationships"=>"http://localhost:7474/db/data/node/0/relationships/all/{-list|&|types}", "self"=>"http://localhost:7474/db/data/node/0", "property"=>"http://localhost:7474/db/data/node/0/properties/{key}", "properties"=>"http://localhost:7474/db/data/node/0/properties", "outgoing_typed_relationships"=>"http://localhost:7474/db/data/node/0/relationships/out/{-list|&|types}", "incoming_relationships"=>"http://localhost:7474/db/data/node/0/relationships/in", "create_relationship"=>"http://localhost:7474/db/data/node/0/relationships", "paged_traverse"=>"http://localhost:7474/db/data/node/0/paged/traverse/{returnType}{?pageSize,leaseTime}", "all_relationships"=>"http://localhost:7474/db/data/node/0/relationships/all", "incoming_typed_relationships"=>"http://localhost:7474/db/data/node/0/relationships/in/{-list|&|types}", "metadata"=>{"id"=>0, "labels"=>[]}, "data"=>{}} 你能确认你的代码中没有"Neography::Rest.new“吗?
发布于 2015-07-30 21:01:37
您可以允许在不进行身份验证的情况下进行访问(尽管这当然不太安全)。
变化
dbms.security.auth_enabled=true至
dbms.security.auth_enabled=false在文件中
conf/neo4j-server.propertieshttps://stackoverflow.com/questions/29269714
复制相似问题