I'm trying to display a Grafana dashboard within a plain PHP page. I followed the website instructions to authentiate with oauth. Here is my code:
$ch = curl_init();
$authorization = "Authorization: Bearer ";
curl_setopt_array(
$ch, array(
CURLOPT_URL => 'url-to-my-dashboard',
CURLOPT_HTTPHEADER => array('Content-Type: application/json' , $authorization),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPAUTH => "HTTP/1.1"
));
$output = curl_exec($ch);
?>
The page loads, I get the CSS... but I end up with a 404 error. I discover that Grafana's headers do not allow this kind of actions:
Access to Font at 'http://xxxxx' from origin 'http://localhost'
has been blocked by CORS policy:
N