2015-07-13 156 views
0

我嘗試使用sonarqube web API來查找重複的源代碼,但我收到錯誤消息。權限不足Sonarqube WebService API

{"errors":[{"msg":"Insufficient privileges"}]} 

我已經嘗試過版本5.1和4.5 LTS。

我將所有權限設置爲「任何人」。

另外我試過在java中發送一個Base64認證,但它總是返回「403」。

URL url = new URL(""); 

    HttpURLConnection connection = (HttpURLConnection) url.openConnection(); 

    String password = "admin:admin"; 

    String base = "Base " + Base64.getEncoder().encodeToString(password.getBytes());   

    connection.setRequestProperty("Authorization", base); 


    connection.connect(); 


    BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); 

    String line; 

    while((line = reader.readLine())!= null) { 
     System.out.println(line); 
    } 

我找不到任何東西,這對我在文檔中的作品。

我不明白,爲什麼它不適合我。

其實我在版本5.1

感謝您的幫助:)

回答

1

String base = "Base " +不應該這是String base = "Basic " +

+0

我也試過,但它並沒有爲我工作。 –

+0

嗯,你想要訪問什麼網址? – Techtwaddle

+0

這是我的網址'http:// localhost:9000/api/sources/scm?key = myProject:src/de/myCompany/utils/MyClass.java' –