Is it possible to use an Enterprise license from a Cordova app?
Design: The Cordova app uses a iframe that points to our registered domain to render the document
When using a embed tag we receive a license warning or "Doconut is licensed to xyz, iframes not allowed for this url: "
From an iframe an image is rendered: “You are not authorized to view this page”
We applied the upgrade license, but receives the following error:
“Init error. Please make sure your web.config has the handler declared. Refer web.config in our sample project or change the BasePath property value. Handler is: DocImage.axd”
Let’s clarify some things. The only site that needs Doconut configuration is the source site, the one that will be displayed on the iFrame, not the one with the iFrame itself.
The site that is hosted at try.doconut.com does not have the correct configuration to be displayed in an iframe, which is why the page on mobile.aspx is not been displayed.
The config is applied on the source/remote domain and not on the test site. The CORS settings was to see if it made any difference.
When rendering the iframe the following message pops up:
“Init error. Make sure your web.config has the handler declared. Refer web.config in our sample project or change the BasePath property value. Handler is: DocImage.axd” and then “Init error or Invalid Token. The document might be closed. Current path is: DocImage.axd”
The server side code:
DocViewer docViewer = null;
docViewer = this.FindControl(“ctlDoc”) as DocViewer;
docViewer.BasePath = “”;
docViewer.OpenDocument(Convert.FromBase64String(doc), response.ResourceContentType);
The DoconutUnSafeMode appSetting is definitely set to true.
DoconutShowInfo is also defined as true (and working)
The same errors are displayed when removing the BasePath property. I’ve also tried to use the full path (https://remotedomain), but it seems that it only allows relative paths.
The source site is working 100%. It also works if the “iframe” domain is from the same “domain”. (if the BasePath is set to “”). It does not work if the “iframe” domain is not from the same domain. We upgrade the licenses to have a no domain restriction. (domain=*)
Can you please check the web.config and server code for minimal.doconut.com? Minimal does not give the init error (just a license error when using from a different iframe)
I can use an iframe with the source in minimal.doconut.com from a local HTML file on my computer which is not part of the doconut.com domain and it works fine, without the init error.
Can you send us the complete web.config file you are using? You can change any private information, but not delete any nodes because we are going to use it to run an example app.
I attached two small projects with an example that is working successfully.
The MinimalSrcIFrame project has the same web.config you shared with us. The MainDomainTestMinimalIframe project loads the iframe and shows the viewer without issues.
This example was tested with the Enterprise license.