Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot log in Neo4j server

Tags:

neo4j

On a fresh install of neo4j-community-2.2.4 I get the message "Invalid username or password." when submitting the login form at localhost:7474/browser with the default username neo4j and password neo4j.

I did enable org.neo4j.server.webserver.address=0.0.0.0 and dbms.security.auth_enabled=true with a server stop and start and a browser shift-reload.

I then changed the property org.neo4j.server.webserver.address=127.0.0.1 to match my /etc/hosts and tried on 127.0.0.1:7474/browser but got the same message.

Here is the browser console output:

Remote Address:127.0.0.1:7474
Request URL:http://localhost:7474/db/data/
Request Method:GET
Status Code:401 Unauthorized
Request Headersview source
Accept:application/json, text/plain, */*
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8,fr;q=0.6,ru;q=0.4,es;q=0.2,sv;q=0.2,nb;q=0.2,et;q=0.2
Authorization:Basic bmVvNGo6bmVvNGo=
Cache-Control:no-cache
Connection:keep-alive
Cookie:languageCodeAdmin=en; PHPSESSID=vcbvfkvj3shajhlh5u2pue9i70; admin_template_phone_client=0; admin_template_touch_client=0; admin_template_model=1
Host:localhost:7474
If-Modified-Since:Wed, 11 Dec 2013 08:00:00 GMT
Pragma:no-cache
Referer:http://localhost:7474/browser/
User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/37.0.2062.120 Chrome/37.0.2062.120 Safari/537.36
X-stream:true
Response Headersview source
Content-Length:135
Content-Type:application/json; charset=UTF-8
Date:Sat, 19 Sep 2015 09:14:03 GMT
Server:Jetty(9.2.4.v20141103)
WWW-Authenticate:None
{
  "errors" : [ {
    "message" : "Invalid username or password.",
    "code" : "Neo.ClientError.Security.AuthorizationFailed"
  } ]
}

So I then tried to change the default password.

To do that, I first disabled the authentication with a dbms.security.auth_enabled=false and a server stop and start.

And I then tried the following curl request:

curl -H "Accept:application/json; charset=UTF-8" -H "Content-Type: application/json" "http://localhost:7474/user/neo4j/password" -X POST -d "{ \"password\" : \"neo4j\" }" -i

But it gives me the response:

HTTP/1.1 404 Not Found
Date: Sat, 19 Sep 2015 09:25:38 GMT
Access-Control-Allow-Origin: *
Content-Length: 0
Server: Jetty(9.2.4.v20141103)
like image 787
Stephane Avatar asked Sep 19 '15 09:09

Stephane


People also ask

Can't connect to Neo4j?

Troubleshooting steps: Ensure that the address is correct. Ensure that if the server is listening for bolt connections on a port other than 7687, that you pass the port explicitly to your client (e.g. cypher-shell) or other program you have written. Ensure that firewall rules do not prohibit traffic on the bolt port.

How do I log into my Neo4j browser?

If you are developing on your local machine with a single instance: Default URL to Neo4j Browser is http://localhost:7474/browser (use your web browser). Default connection URL to Neo4j is bolt://localhost:7687 . Neo4j Browser is available as a web application at https://browser.graphapp.io/.

How do I enable authentication on Neo4j?

Contents. Authentication and authorization are enabled by default in Neo4j (refer to Operations Manual → Authentication and authorization). With authentication and authorization enabled, requests to the HTTP API must be authorized using the username and password of a valid user.


2 Answers

Since you get an authentication error on your browser request which uses the default credentials neo4j:neo4j your database has already a different password configured. To reset it to default, stop neo4j, delete data/dbms/auth and start it again. Now you can use the default pw.

like image 164
Stefan Armbruster Avatar answered Sep 20 '22 14:09

Stefan Armbruster


In my case Neo4J windows services was not installed just followed below steps

  1. neo4j.bat install-services
  2. neo4j.bat status
  3. neo4j.bat start

it worked, cheers

like image 29
Vamsee fl Avatar answered Sep 17 '22 14:09

Vamsee fl