我尝试使用 sonarqube Web 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 版
谢谢你的帮助 :)