I have a login screen that coded with js and runs on a node.js server. I have an apache lounge server that listens to node server and I have a grafana dashboard that show the data. I need to bypass the grafana authentication. To do that I am trying to send userdata from apache server to grafana with basic authentication. When I'm tring to send data only with apache server I can send data and baypass the grafana authentication. But when I'm trying to send data from node server to grafana with apache server I can't send data to grafana server. I'm new to node.js so can anyone help me?
Here is the sample of my code.
app.get('/dashboard',(req,res) => {
if(session.userdata ='ok'){
var options = {
url:req.session.url,
auth: {
user : req.session.userName,
password : req.session.password
}
}
request(options,function(err,res,body)
{
console.log('headers',res.headers)
}
}
}
I already try to solve my problem with these questions. Here, Here and Here
Thank you for your helps.