Auth Problem when connecting to Neo4j Server (Ubuntu)

2,915 views
Skip to first unread message

appren...@gmail.com

unread,
Jun 20, 2017, 6:02:16 PM6/20/17
to Neo4j
I'm trying to setup neo4j on ubuntu virtual server but having issues connecting.

curl -H "Accept: application/json; charset=UTF-8" -H "Content-Type: application/json" -X POST http://localhost:7474/db/data/cypher -d '{
>   "query" : "CREATE (n:Person { name : {name} }) RETURN n",
>   "params" : {
>     "name" : "Foo"
>   }
> }'
{
  "errors" : [ {
    "code" : "Neo.ClientError.Security.Unauthorized",
    "message" : "No authentication header supplied."
  } ]
}



if i try to change password with 'neo4j-admin set-initial-password'
i get : command failed: initial password was not set because live Neo4j-users were detected.

when i try to change the password with a rest call:

curl -H "Accept: application/json; charset=UTF-8" -H "Content-Type: application/json" -X POST http://localhost:7474/user/neo4j/newpass12
{
  "errors" : [ {
    "code" : "Neo.ClientError.Security.Unauthorized",
    "message" : "No authentication header supplied."
  } ]
}

Michael Hunger

unread,
Jun 21, 2017, 1:52:38 AM6/21/17
to ne...@googlegroups.com
You can remove data/dbms/auth and try neo4j-admin again 

And then provide -u neo4j:password to curl for auth

Von meinem iPhone gesendet
--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

appren...@gmail.com

unread,
Jun 21, 2017, 4:18:27 AM6/21/17
to Neo4j
But I still get "Invalid username or password."" on

curl -H "Accept: application/json; charset=UTF-8" -H "Content-Type: application/json" -X POST -u neo4j:newpass1 http://localhost:7474/db/data/cypher -d '{
>   "query" : "CREATE (n:Person { name : {name} }) RETURN n",
>   "params" : {
>     "name" : "Foo"
>   }
> }'
{
  "errors" : [ {
    "code" : "Neo.ClientError.Security.Unauthorized",
    "message" : "Invalid username or password."
  } ]
}


Steps performed:

1. sudo rm /var/lib/neo4j/data/dbms/auth
2. sudo neo4j-admin set-initial-password newpass1
3. curl for auth 

curl -H "Accept: application/json; charset=UTF-8" -H "Content-Type: application/json" -X GET -u neo4j:newpass1 http://localhost:7474/
{
  "bolt" : "bolt://localhost:7687"
}

4. Create a new node 

curl -H "Accept: application/json; charset=UTF-8" -H "Content-Type: application/json" -X POST -u neo4j:newpass1 http://localhost:7474/db/data/cypher -d '{
>   "query" : "CREATE (n:Person { name : {name} }) RETURN n",
>   "params" : {
>     "name" : "Foo"
>   }
> }'
{
  "errors" : [ {
    "code" : "Neo.ClientError.Security.Unauthorized",
    "message" : "Invalid username or password."
  } ]
}

Did i miss something?

Michael Hunger

unread,
Jun 21, 2017, 4:22:21 AM6/21/17
to ne...@googlegroups.com

On Wed, Jun 21, 2017 at 10:18 AM, <appren...@gmail.com> wrote:
http://localhost:7474/

this endpoint is unauthenticated: http://localhost:7474/


use /db/data/transaction
not sure how the old endpoint works with regard to auth

Message has been deleted
Message has been deleted
Message has been deleted

Michael Hunger

unread,
Jul 11, 2017, 3:00:11 AM7/11/17
to ne...@googlegroups.com
From our team:

Not Nginx specifically. Internally we use a Haproxy reverse proxy. I think the only things we've had to do are set an explicit timeout for the tunnelled connections (2 min) and configure it to log at the start of a connection (because connection pooling makes disconnection rare).


On Wed, Jun 21, 2017 at 6:55 PM, <appren...@gmail.com> wrote:
I think nginx is causing connection refused on localhost:7474

Do you have the settings for nginx?

--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages