Reputation: 1
I try using the sonarqube web API to find duplicated source code, but I get the error message.
{"errors":[{"msg":"Insufficient privileges"}]}
I have tried it on version 5.1 and 4.5 LTS.
I set all permissions to "anyone".
Also I've tried to send a Base64 authentication in java, but it always returns "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);
}
I have found nothing, that works for me in the documentation.
I can't understand, why it doesn't work for me.
Actually I'm on version 5.1
Thanks for your help :)
Upvotes: 0
Views: 825
Reputation: 1711
String base = "Base " +
shouldn't this be String base = "Basic " +
Upvotes: 1