Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting "Invalid authorization token supplied" (Neo.ClientError.Security.AuthorizationFailed) error #165

Open
AlexanderMatveev opened this issue Jan 16, 2015 · 3 comments

Comments

@AlexanderMatveev
Copy link

I'm using Getting started code: https://github.com/jadell/neo4jphp/wiki/Getting-started
Server has dbms.security.authorization_enabled=true, 7473 is http port.

I'm using neo4jphp:

use Everyman\Neo4j\Client, Everyman\Neo4j\Cypher\Query;
$neo4j = new Everyman\Neo4j\Client('localhost', 7473);
$neo4j->getTransport()->setAuth('...', '...');
This works fine.

But this line:

var_dump($neo4j->getServerInfo());

..returns error:

[message] => Invalid authorization token supplied.
[code] => Neo.ClientError.Security.AuthorizationFailed

@keelerm84
Copy link

I was just running into this. I was able to get it working by doing the following:

Change the password for the neo4j user by doing:

curl -H "Content-Type: application/json" -d '{"new_password":"whatever","password":"neo4j}' http://localhost:7474/user/neo4j/password

This will provide you with an authorization_token. If you then use that token as the password field in setAuth, you should be able to make successful requests.

@AlexanderMatveev
Copy link
Author

@keelerm84 This means that we must change password every time?

@keelerm84
Copy link

I don't think so. Once you have generated an authorization_token, that should persist until you specifically request that it generate a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants