• United States
IBM?
  • Site map
IBM?
  • Marketplace

  • Close
    Search
  • Sign in
    • Sign in
    • Register
  • IBM Navigation
IBM Developer Answers
  • Spaces
    • Blockchain
    • IBM Cloud platform
    • Internet of Things
    • Predictive Analytics
    • Watson
    • See all spaces
  • Tags
  • Users
  • Badges
  • FAQ
  • Help
Close

Name

Community

  • Learn
  • Develop
  • Connect

Discover IBM

  • ConnectMarketplace
  • Products
  • Services
  • Industries
  • Careers
  • Partners
  • Support
10.190.13.195

Refine your search by using the following advanced search options.

Criteria Usage
Questions with keyword1 or keyword2 keyword1 keyword2
Questions with a mandatory word, e.g. keyword2 keyword1 +keyword2
Questions excluding a word, e.g. keyword2 keyword1 -keyword2
Questions with keyword(s) and a specific tag keyword1 [tag1]
Questions with keyword(s) and either of two or more specific tags keyword1 [tag1] [tag2]
To search for all posts by a user or all posts with a specific tag, start typing and choose from the suggestion list. Do not use a plus or minus sign with a tag, e.g., +[tag1].
  • Ask a question

Unable to initialise the dynamic dashboard API due to frame-ancestors Security Policy Directive

270001TNY4 gravatar image
Question by John.MacLeod  (1) | Apr 04, 2018 at 04:11 AM cognos-dashboard-embeddeddynamic-dashboard-embedded

I'm unable to initialise the dynamic dashboard API due to a frame-ancestors Security Policy Directive - presumably because the frame contents and the web page come from different domains. However there are samples that work!

Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://dde-us-south.analytics.ibm.com') does not match the recipient window's origin ('https://nrjhmXXXX.mybluemix.net').

Refused to display 'https://dde-us-south.analytics.ibm.com/daas/?perspective=postMessageApiLoader≈iKey=capi_1628fa658af∥entOrigin=https%3A%2F%2FnrjhmXXXX.mybluemix.net&sessionCode=CDXXXXXXXXXXXXXX' in a frame because an ancestor violates the following Content Security Policy directive: "frame-ancestors https://dde-us-south.analytics.ibm.com".

 <html>
     <head>
         <script src="https://dde-us-south.analytics.ibm.com/daas/CognosApi.js"></script>
     </head>
 <body>
     <h1>Hello World</h1>
     <div id="ddeDashboard"></div>
 </body>
             <script type="text/javascript">
 
         window.api = new CognosApi({
             cognosRootURL: 'https://dde-us-south.analytics.ibm.com/daas/',
             node: document.getElementById("ddeDashboard"),
             sessionCode: 'CDXXXXXXXXXXXXXX'
         });
         window.api.initialize().then(function() {
                 console.log('API created successfully.');
             }, function(err) {
                 console.log('Failed to create API. ' + err.message);
             });
         window.onError = function(event) {
             console.log('onError:' + JSON.stringify(event));
         };
         window.api.on(CognosApi.EVENTS.REQUEST_ERROR, window.onError);
         window.dashboardAPI = window.api.dashboard.createNew().then(
             function(dashboardAPI) {
                 console.log('Dashboard created successfully.');
                 // window.dashboardAPI = dashboardAPI;
             }
             ).catch(
             function(err) {
                 console.log('User hit cancel on the template picker page.');
             }
             );
         </script>
 </html>

People who like this

  0
Comment
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster

2 answers

  • Sort: 
120000BGUR gravatar image

Answer by Van Staub (57) | Apr 04, 2018 at 10:23 AM

I ran into this as well and filed a documentation defect. Here was my guidance.

As the name suggests, DDE embeds a dashboard within your existing web application. It does this by injecting an HTML iframe into your application. The frame may only be loaded into authorized web applications. As a result, you may see the following error, which suggests that your application is not authorized.

Refused to display IBM URL in a frame because an ancestor violates the following Content Security Policy directive: frame-ancestors https://myapp.bluemix.net.

To resolve this issue, confirm that the URL (including port if applicable) in the address bar of your browser matches the webDomain property of the /daas/v1/session POST body.

     expiresIn: 3600,
     webDomain: 'https://myapp.bluemix.net'

This can be an initial stumbling point because the Dynamic Dashboard Embedded API explorer page uses SAMEORIGIN, but this does not apply to your external application.

Comment
neoslimjim

People who like this

  1   Show 1   Share
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
270001K5AB gravatar image neoslimjim (0)   Apr 05, 2018 at 08:18 AM 0
Share

Van is spot on, with his answer. You need to specify the webdomain of your application that will contain the DDE dashboard, in the POST request to create the session. We'll update the documentation to make this clearer.

Thanks for the feedback!

270001TNY4 gravatar image

Answer by John.MacLeod (1) | May 16, 2018 at 07:08 PM

Thanks Van - should have updated this sooner. Exactly the issue!

Comment

People who like this

  0   Share
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster

Follow this question

132 people are following this question.

Answers

Answers & comments

Related questions

How can I add a file to Data Asset by Notebook? 1 Answer

How can I get dashboardSpec information? 4 Answers

What is Dynamic Dashboard Embedded? 1 Answer

Dynamic Dash connect to internal IBM (Bluezone) data sources? 0 Answers

"Query Service internal error" after replacing data source module CSV URL with my own. 1 Answer

  • Contact
  • Privacy
  • IBM Developer Terms of use
  • Accessibility
  • Report Abuse
  • Cookie Preferences

Powered by AnswerHub

Authentication check. Please ignore.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • API Connect
  • Analytic Hybrid Cloud Core
  • Application Performance Management
  • Appsecdev
  • BPM
  • Blockchain
  • Business Transaction Intelligence
  • CAPI
  • CAPI SNAP
  • CICS
  • Cloud Analytics
  • Cloud Automation
  • Cloud Object Storage
  • Cloud marketplace
  • Collaboration
  • Content Services (ECM)
  • Continuous Testing
  • Courses
  • Customer Experience Analytics
  • DB2 LUW
  • DataPower
  • Decision Optimization
  • DevOps Services
  • Developers IBM MX
  • Digital Commerce
  • Digital Experience
  • Finance
  • Global Entrepreneur Program
  • Hadoop
  • Hybrid Cloud Core
  • IBM Cloud platform
  • IBM Design
  • IBM Forms Experience Builder
  • IBM Maximo Developer
  • IBM StoredIQ
  • IBM StoredIQ-Cartridges
  • IIDR
  • ITOA
  • InformationServer
  • Integration Bus
  • Internet of Things
  • Kenexa
  • Linux on Power
  • LinuxONE
  • MDM
  • Mainframe
  • Messaging
  • Node.js
  • ODM
  • Open
  • PowerAI
  • PowerVC
  • Predictive Analytics
  • Product Insights
  • PureData for Analytics
  • Push
  • QRadar App Development
  • Run Book Automation
  • Search Insights
  • Security Core
  • Storage
  • Storage Core
  • Streamsdev
  • Supply Chain Business Network
  • Supply Chain Insights
  • Swift
  • UBX Capture
  • Universal Behavior Exchange
  • UrbanCode
  • WASdev
  • WSRR
  • Watson
  • Watson Campaign Automation
  • Watson Content Hub
  • Watson Marketing Insights
  • dW Answers Help
  • dW Premium
  • developerWorks Sandbox
  • developerWorks Team
  • Watson Health
  • More
  • Tags
  • Questions
  • Users
  • Badges