neo4j产生“没有提供授权头”错误

时间:2015-08-12 13:25:37

标签: amazon-web-services amazon-ec2 neo4j

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

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"
  } ]

我是否正确登录或者错过了某个地方的步骤?

感谢任何帮助。

1 个答案:

答案 0 :(得分:11)

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

Authorization: Basic bmVvNGo6bmVvNGo=

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

bmVvNGo6bmVvNGo= is default Neo4j password: neo4j

by @ michael-hunger

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

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

或者在Neo4j配置中关闭授权

CONF / neo4j-server.properties

# Disable authorization 
dbms.security.auth_enabled=false

以下是有关该

的更多信息

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