Hi,
The embedding feature look nice. Currently 4 examples are given but for non Java application.
I tried to do insert the code in a java app by including the io.jsonwebtoken library?
I also used the org.json.JSONObject to build a json object.
// Fisrt, I create the Json object
JSONObject jsonObject1 = new JSONObject();
jsonObject1.put(“dashboard”, “2”);
JSONObject jsonObject = new JSONObject();
jsonObject.put(“resource”, jsonObject1);
jsonObject.put(“params”, “”);
// Then my claims
Claims claims2 = Jwts.claims();
claims2.put(“payload”,jsonObject.toString());
//Finally the token
String token = Jwts.builder()
.setClaims(claims2)
.signWith(SignatureAlgorithm.HS256, METABASE_SECRET_KEY)
.compact();
//then, I insert my iframeUrl string.
String iframeUrl = METABASE_SITE_URL + “/embed/dashboard/” + token + “#bordered=true&titled=true”;
When I load my page, I got a metabase feedback : “Message seems corrupt or manipulated.”
Claims 2 generated by the program : {payload={“resource”:{“dashboard”:“2”},“params”:""}}
If I do a java - claims.get(“payload”); - , I get : {“resource”:{“dashboard”:“2”},“params”:""}
Everything looks ok. I do not understand why it is not working. I have check my metabase_secret_key, that the embedded dashboard is published …
Did anyone succeed to embed a dashboard in a java app ? If yes, help is welcome.
Thanks in advance,
FBS