Stephane
Stephane

Reputation: 12740

Cannot log in Neo4j server

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)

Upvotes: 13

Views: 9470

Answers (2)

Vamsee fl
Vamsee fl

Reputation: 9

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

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

it worked, cheers

Upvotes: 1

Stefan Armbruster
Stefan Armbruster

Reputation: 39905

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.

Upvotes: 12

Related Questions