2015-05-02 27 views
0

可能是一個愚蠢的問題,但我如何禁用新的Neo4j版本的基本認證?我擡頭看了How to disable Basic Auth on Neo4j 2.2.0-RC01,但是 - 慚愧 - 我無法找到conf/neo4j-server.properties,也無法像手冊中提到的那樣改變data/dbms/auth的permamently。每次重新啓動Neo4J都會將auth文件重置爲以前的內容並刪除我的條目。我正在使用Windows 8,並在Neo4j社區文件夾中找不到設置任何屬性的方法。如何在Neo4j 2.2.1中禁用基本身份驗證?

作爲替代方案,我將不勝感激提示如何讓everyman_neo4j_client向Neo4J DB發送認證,這也將解決問題,並且無論如何都會更安全。

也許有人對我有提示?

回答

1

project爲例,看起來Transport類中有一個setAuth方法,您可以使用它。

/** 
* Set username and password to use with HTTP Basic Auth 
* 
* Returns this Trnasport object 
* 
* @param string $username 
* @param string $password 
* @return Transport 
*/ 
public function setAuth($username=null, $password=null) 
{ 
    $this->username = $username; 
    $this->password = $password; 
    return $this; 
} 

你可能需要做這樣的事情..

$transport = new Transport('localhost', 7474); 
$transport->setAuth('neo4j', 'password') 
$client = new Client($transport); 
+0

謝謝,這幫助:) – Balael