Вот работающий вариант:
public static void makeAuthRequest(URL url) throws IOException {
HttpsURLConnection uc = (HttpsURLConnection) url.openConnection();
uc.setRequestProperty("X-Requested-With", "Curl");
String userpass = "login" + ":" + "password";
String basicAuth = "Basic " + String.valueOf(Base64.encode(userpass.getBytes(), Base64.DEFAULT));
uc.setRequestProperty("Authorization", basicAuth);
InputStreamReader inputStreamReader = new InputStreamReader(uc.getInputStream());
Scanner sc = new Scanner(inputStreamReader);
sc.useDelimiter("\\A");
if (sc.hasNext()) {
String str = sc.next();
Log.d("TAG", str);
}
uc.disconnect();
}