Hello !
So i’m currently playing with the metabase secure embedding.
I’m currently trying to embed questions, i’ve took some PHP sample to do this, here’s a sample :
$metabaseSiteUrl = 'http://localhost';
$metabaseSecretKey = 'MYSUPERSECRETKEY';
$signer = new \Lcobucci\JWT\Signer\Hmac\Sha256();
$token = (new \Lcobucci\JWT\Builder())
->set('resource', ['question' => 1])
->set('params', [])
->sign($signer, $metabaseSecretKey)
->getToken();
$iframeUrl = "$metabaseSiteUrl/embed/question/$token#bordered=true&titled=true";
?>
<iframe
src="<?php echo $iframeUrl ?>" frameborder="0"
width="100%"
height="800"
allowtransparency
></iframe>
I’ve tried this with two different questions (both questions doesn’t take any custom settings). And for both question, the frame display this message : Assert failed: (map? token-params)
To be honest, i don’t have any idea of the problem (tried another jwt generation library, same problem)
If anyone have an idea about this problem, feel free to answer
Thanks !