neo4j产生“未提供授权头".错误

问题描述:

我正在尝试从出现授权错误的命令行访问在aws ec2实例上运行的neo4j.我启用了org.neo4j.server.webserver.address=0.0.0.0并使用ec2主机名在第一条语句上获得了503错误,其余语句得到了相同的错误.

I'm trying to access neo4j running on an aws ec2 instance from the command line where I get authorisation errors. I've enabled org.neo4j.server.webserver.address=0.0.0.0 and get a 503 error on the first statement and the same errors for the rest using the ec2 host name.

ubuntu@ip-10-0-0-192:/etc/neo4j$ curl http://localhost:7474/
{
  "management" : "http://localhost:7474/db/manage/",
  "data" : "http://localhost:7474/db/data/"
}ubuntu@ip-10-0-0-192:/etc/neo4j$ curl http://localhost:7474/db/data/
{
  "errors" : [ {
    "message" : "No authorization header supplied.",
    "code" : "Neo.ClientError.Security.AuthorizationFailed"
  } ]
}ubuntu@ip-10-0-0-192:/etc/neo4j$ curl http://localhost:7474/user/neo4j/
{
  "errors" : [ {
    "message" : "No authorization header supplied.",
    "code" : "Neo.ClientError.Security.AuthorizationFailed"
  } ]
ubuntu@ip-10-0-0-192:/etc/neo4j$ curl http://localhost:7474/user/neo4j/password
{
  "errors" : [ {
    "message" : "No authorization header supplied.",
    "code" : "Neo.ClientError.Security.AuthorizationFailed"
  } ]

我是否正确登录还是错过了某个地方的行程?

Am I logging in correctly or have I missed a step somewhere?

感谢您的帮助.

您需要在请求中提供授权标头

You need to provide authorization header in your request

Authorization: Basic bmVvNGo6bmVvNGo=

curl --header "Authorization: Basic bmVvNGo6bmVvNGo=" http://localhost:7474

bmVvNGo6bmVvNGo= is default Neo4j password: neo4j

由@ michael-hunger

by @michael-hunger

注意:对于auth API,您仍然需要授权.

note: For the auth APIs you still need authorization.

curl -u neo4j:password http://localhost:7474

或在Neo4j配置中关闭授权

Or turn off authorization in Neo4j configuration

conf/neo4j-server.properties

conf/neo4j-server.properties

# Disable authorization 
dbms.security.auth_enabled=false

这是有关此的更多信息

http://neo4j.com/docs/stable/rest-api- security.html