I was trying out to open a grafana url from the javascript by embedding auth inside. Grafana expects the authorisation header to open, i have tried the following code but it is not working. Can someone help how can we fix this ?
onClick={function() {
var that = window;
$.ajax({
url: "http://localhost:3000",
type: "GET",
beforeSend: function (xhr) {
xhr.setRequestHeader ("Authorization", "Basic " + btoa("admin" + ":" + "admin"));},
success: function(oRes) { that.open(oRes,"_blank");}
});
}