Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

Unable to embed Oracle Anaytics dashboard on public website

Received Response
484
Views
18
Comments
Ankan Chanda
Ankan Chanda Rank 4 - Community Specialist

Content

We are trying to embed OAC (oracle analytics cloud) graph/canvas on public webpage, we have created an application in IDCS (identity cloud service) and generated client id and client secret, which we encoded in base 64 encoder and generated access token which we used in webpage. Copied the code from OAC dashboard developer option embed section and included it in webpage, but while executing the webpage, we are facing an error saying "AJAX request failed during bootstrap. Request 'https://oac100-bmbriwuhm2ek-bo.analytics.ocp.oraclecloud.com:443/ui/dv/ui/api/v1/sessioninfo/ext'; response:". 

Version

5.9

Code Snippet

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html dir="ltr">
<head>
<title>Oracle Analytics Cloud Embedding Sample</title>

   <script src="https://oac100-bmbriwuhm2ek-bo.analytics.ocp.oraclecloud.com/public/dv/v1/embedding/standalone/embedding.js" type="application/javascript">
</script>
</head>
<body>
<div style="text-align: center">
<h1>Oracle Analytics Cloud Embedding Sample</h1>
</div>
<div style="position: absolute; width: calc(100% — 40px); height: calc(100% — 120px)">
<oracle-dv project-path="/@Catalog/users/vaibhav.inamdar@omfysgroup.com/Dashboard" active-page="canvas" active-tab-id="2">
</oracle-dv>
</div>


<script>
var token = "eyJ4NXQjUzI1NiI6IldDMjJfQTFtNzVyX0JuczROZzdES1Z1S2x2RjdRaFdQODlxRnA3ZHdrS3ciLCJ4NXQiOiJzQWFWVEJKNmx1eFEwVU1ET1FKaDhBU29nMU0iLCJraWQiOiJTSUdOSU5HX0tFWSIsImFsZyI6IlJTMjU2In0.eyJ1c2VyX3R6IjoiQW1lcmljYVwvQ2hpY2FnbyIsInN1YiI6InZhaWJoYXYuaW5hbWRhckBvbWZ5c2dyb3VwLmNvbSIsInVzZXJfbG9jYWxlIjoiZW4iLCJpZHBfbmFtZSI6IlVzZXJOYW1lUGFzc3dvcmQiLCJ1c2VyLnRlbmFud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oiY2FjY3QtYzE3MjYxMjNmM2NiNDMyNDkxNjkzZWIzMjg3MWNhYzYiLCJhdWQiOlsidXJuOm9wYzpsYmFhczpsb2dpY2FsZ3VpZD1pZGNzLTdjYzIxYTUxMjg3ZjRjNjI4ZTgxMTQzMjlhMzIzNTg2IiwiaHR0cHM6XC9cL2lkY3MtN2NjMjFhNTEyODdmNGM2MjhlODExNDMyOWEzMjM1ODYuaWRlbnRpdHkub3JhY2xlY2xvdWQuY29tIl0sInVzZXJfaWQiOiIwNmQ1NjczZjc4NDk0M2NiYWNjNmVmODJkNTE2OWY0OSIsImNsaWVudEFwcFJvbGVzIjpbIkF1dGhlbnRpY2F0ZWQgQ2xpZW50IiwiQ3Jvc3MgVGVuYW50Il0sInRlbmFudF9pc3MiOiJodHRwczpcL1wvaWRjcy03Y2MyMWE1MTI4N2Y0YzYyOGU4MTE0MzI5YTMyMzU4Ni5pZGVudGl0eS5vcmFjbGVjbG91ZC5jb206NDQzIn0.iokdqTlEpJvNpj920zMY_GoXETdH6qLqdPTntth4iAosdNMZLKMz8cOn-87QDEKYDTyvM3Wa7PwqPZnVlRi236uIrtzr2e6iPloEhzpD-oMWlyg6_8Je2EuhWyzJCITSX4AbcqhBk3Ef0mp6O0eiQK3bKZNtNVhshe2JMmNESMC0z8S9Ll5gKCDTxeyWZuN51sZTBst6uimQ7PCcSHSTK6TaHM014avs-EdFyC8-SwCQiST-268Z8cpywKFR76hRuNqyTXUF_X6Aqs06xafbHDFp7TPxsWJ4eefE1w0nyifNQRIrUpNoR3YAu38hJjEvHwUPcLOmI8folqpfpKS-lw";
  requirejs(['jquery', 'knockout', 'obitech-application/application', 'jet-composites/oracle-dv/loader'],
  function($, ko, application) {
  application.setSecurityConfig("token", {tokenAuthFunction:
  function(){
  return token;
  }
  });
  ko.applyBindings();
  }
  );
</script>
</body>
</html>

ajax_errr.PNG

«1

Answers

  • Neeti Choksi-Oracle
    Neeti Choksi-Oracle Rank 4 - Community Specialist

    Hi Ankan,

    Looks like the token is expired. Default expiry time for the token is 100 seconds. You need to increase the token lifetime.

    Can you confirm the token expiry time when you created one?

    Sample -
    {“access_token”:”...<token shortened>...”,”token_type”:”Bearer”,”expires_in”:100}

    Regards,

    Neeti

  • Ankan Chanda
    Ankan Chanda Rank 4 - Community Specialist

    Hi Neeti, 

    I have increased the token expiry time to 1000 mins and then generated token using IDCS ,

    but still having the trouble to connect.

  • Neeti Choksi-Oracle
    Neeti Choksi-Oracle Rank 4 - Community Specialist

    I see. Have you registered your web server as a safe domain in OAC console with the permission to embed?

  • Ankan Chanda
    Ankan Chanda Rank 4 - Community Specialist

    yes i did that even we have tried using SSL certificate as well.

  • Neeti Choksi-Oracle
    Neeti Choksi-Oracle Rank 4 - Community Specialist

    Then it must be the invalid token issue. Can you please share the steps you performed to increase token lifetime and to create the token, and also the output (if possible) of the token creation process?

  • In addition, as a double-check these troubleshooting steps may be helpful.

    Especially, the safe domains and using the browser developer tools to check. Additionally, browsers now enforce same-site cookies by default.
    All OAC instances should already be updated if manually disabling same-site cookies makes it work, but it is a good troubleshooting checkpoint.

    https://medium.com/@insight2action/oracle-analytics-troubleshooting-embedded-content-20eccbc84f6c

  • Ankan Chanda
    Ankan Chanda Rank 4 - Community Specialist

    Yesterday we generated access token using curl command having an expiry time of 20mins. But still the access token is getting expired within its time limit and while inspecting the html page in network section it says "invalid token". Please have a look at the attached word document. 

  • Neeti Choksi-Oracle
    Neeti Choksi-Oracle Rank 4 - Community Specialist

    Can you please tell me how are you increasing the timeout for the token?

  • Ankan Chanda
    Ankan Chanda Rank 4 - Community Specialist

    We did go through the above article but it lead us to the same errors all over again. Please have a look at the attached document.

  • Ankan Chanda
    Ankan Chanda Rank 4 - Community Specialist

    Actually we came to notice that we  aren't increasing the timeout but getting as a default of 100 seconds, so how to increase the timeout ?