Search code examples
neo4jneo4jclient

how to use neo4jclient to connect to neo4j(not localhost)


I am using neo4jClient to connect to neo4j(not localhost,just like [http://someplace:7474]) Now I always get the answer "401 unauthorized". It seems I need to enter username ans password? Can anyone help me? Thanks a lot~


Solution

  • If you have deployed Neo4j yourself, somewhere on your own network, then the issue is on the server, not the client. By default, the server is secured so that it can only be accessed from localhost: http://docs.neo4j.org/chunked/stable/security-server.html

    If you are using a service, like GrapheneDB, then they will be securing your endpoint with a username and password. Encode these into the URL: https://user:pass@server:7474/db/data.

    Whatever you do never use HTTP and basic authentication at the same time. That is, never send an authentication credential over HTTP.