How to resolve CORS from play framework 1.5.x - playframework-1.x

My chrome is show this error:
Get top window error, error: DOMException: Blocked a frame with origin "https://login.dingtalk.com" from accessing a cross-origin frame.

Related

Do CORS restrictions apply to browser windows as well ? HTML Editor:127.0.0.1:5000, Img editor:127.0.0.1:8000. Sending img results back causes a CORS

I have a app on 127.0.0.1:5000 that edits a page (html code)
If I need to edit a picture on that page using a specialized editor I select the picture and then I fire up a call to 127.0.0.1:8000/picture_editor?picture_url="127.0.0.1:5000/static/uploads/picture.jpg
All good so far, I am able to edit the picture and I have code that should send the results back to the parent window and integrate the changes in the editor
The problem is that this triggers a CORS (cross origins resource sharing) security exception and the call does not complete Here is the error:
svg-editor.html?picture_url=http://127.0.0.1:5000/static/uploads/picture.jpg&width=225&height=276:64 Uncaught DOMException: Blocked a frame with origin "http://localhost:8000" from accessing a cross-origin frame.
What are my options to deal with this ? Is there any way to deal with this ? This is not really CORS site to site but rather the browser not allowing the communication betweek two windows that belong to different sites (although only the port differs)
My app is a flask application and I already enabled CORS there
app = Flask(__name__)
cors = CORS(app, resources={r"*": {"origins": "*"}})
But the browser is still reporting the above error.
Yes CORS has is actually specifically about this and it does not allow the code from a browser window accessing one site to interact with the code in another window that was loaded from another site
As far as my problem goes I found that the editor has an ES6 version that can be loaded without running the Node server (in my case the server running on port 8000)
Toying with the CORS setttings for flask and Node.js (have no clue how to do that) proved to be insufficient for Flask (the above did not solve my problem) and proved to be too difficult for me to do it on Node.js which I do not know anything about

PowerBI Embedded not working because of X-Frame-Options

I'm using powerbi-service-js to embed reports in my Angular 8 application. Until October 3rd, everything worked fine. I would log in to the url (https://login.microsoftonline.com/common/oauth2/token) and then make a request to the powerbi API to get the report token. But now, when using pbiService's embed function, I get the following error. I'm using DirectQuery to construct the report and Deploying the Application in Nginx.
That's the error on Chrome console:
Refused to display 'https://app.powerbi.com/tokenRefresh?ver=1570487269987' in a frame because it set 'X-Frame-Options' to 'sameorigin'.
ERROR DOMException: Blocked a frame with origin "https://app.powerbi.com" from accessing a cross-origin frame.
at e.retryTokenRefresh (https://app.powerbi.com/13.0.10956.175/scripts/reportEmbed.min.js:1:2245948)
at e.onTokenRefreshLoad (https://app.powerbi.com/13.0.10956.175/scripts/reportEmbed.min.js:1:2245770)
at HTMLIFrameElement.document.getElementById.onload [as __zone_symbol__ON_PROPERTYload] (https://app.powerbi.com/13.0.10956.175/scripts/reportEmbed.min.js:1:2245299)
And probably you are viewing this using Google Chrome browser? Because since the date you mentioned, it blocks mixed content. So check your URLs and make sure you do not use HTTP, but all of them are HTTPS. You can confirm this theory by viewing your app in another browser.

WSO2 IoT 3.0.0 and 3.1.0 Device Location Not Showing

After enrolling a device and going to the Device Location tab I get the following errors and it shows a blank grey box where the map should be. I did not had this with EMM 2.2.0.
Failed to load resource: the server responded with a status of 400 (Bad Request)
https://172.16.21.73:9443/devicemgt/api/invoker/execute/
combined.js:5094 Uncaught TypeError: Cannot read property 'lat' of undefined
at loadLeafletMap (combined.js:5094)
at HTMLLIElement. (combined.js:5120)
at HTMLLIElement.dispatch (jquery-1.11.3.min.js:4)
at HTMLLIElement.r.handle (jquery-1.11.3.min.js:4)

XMLHttpRequest No 'Access-Control-Allow-Origin' header From SimpleHttpServer

I am writing a rails backend app. I am providing a rest api to the frontend developer who is workng separately. So for time being I have enabled Cross origin resource sharing by adding following in my application.rb:
#todo remove this once ui is integrated into the app. following allows requests from other domains (disble CORS).
config.action_dispatch.default_headers.merge!({
'Access-Control-Allow-Origin' => '*',
'Access-Control-Request-Method' => '*'
});
I am trying to test out the api by using links on a simple HTML page which I am running off of the python SimplHttpServer. The page is being served at http: // localhost:8000/TestPage.html
When I test one of the links (it sends an ajax request using jquery to the backend which at the moment is running locally as well, on http: // localhost : 3000), I get following error:
GET http://localhost:3000/campaigns/my_campaigns?user_email=swapna%40urbancoding.net&user_token=SNa2kPqkm5ENsZMx7yEi
XMLHttpRequest cannot load http://localhost:3000/campaigns/my_campaigns?user_email=xyz.xyz.com&user_token=xyz. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost : 8000' is therefore not allowed access. The response had HTTP status code 500.
What is going on? How can I resolve this?
Turns out the issue was that the url I was sending the request to (http:// localhost:3000/campaigns/my_campaigns) was incorrect. It was matching an action I did not intend it to match. This action was triggering a 'missing template' exception. Somehow this was causing the No 'Access-Control-Allow-Origin' error. Not sure how that happens, but once I fixed my url to go to the intended action, all was well.

App request dialog shows 500 internal server error

I'm using facebook's app app request dialog. It used to work fine...but I get the following error message with infinite loading image.
"NetworkError: 500 Internal Server Error - https://www.facebook.com/dialog/apprequest?access_token=AAACvZBzj3fc0BAETVk8NOCiXqsGq2uXlUC0EUUX1pMXIPWxfIrhbboHQCvBPR0XKasdfFU30ZCpq1C4GqfEZD&api_key=19349352asdf95789&app_id=19349adf27395789&channel=https%3A%2F%2Fs-static.ak.fbcdn.net%2Fconnect%2Fxd_proxy.php%3Fversion%3D3%23cb%3Df3fb42d06cf1cf4%26origin%3Dhttp%253A%252F%252Fasdf%252Ff3aaa156051f95%26relation%3Dparent.parent%26transport%3Dpostmessage&channel_url=https%3A%2F%2Fs-static.ak.fbcdn.net%2Fconnect%2Fxd_proxy.php%3Fversion%3D3%23cb%3Df3b386a6f30f464%26origin%3Dhttp%253A%252F%252Fasdfm%252Ff3aaa156051f95%26relation%3Dparent.parent%26transport%3Dpostmessage&data=%7B%7D&display=iframe&locale=en_US&message=0&next=https%3A%2F%2Fs-static.ak.fbcdn.net%2Fconnect%2Fxd_proxy.php%3Fversion%3D3%23cb%3Df60d0ad8457e2%26origin%3Dhttp%253A%252F%252Fdev-sherlock.thecimarrongroup.com%252Ff3aaa156051f95%26relation%3Dparent%26transport%3Dpostmessage%26frame%3Df19043b1779432%26result%3D%2522xxRESULTTOKENxx%2522&sdk=joey"
uncaught exception: Error: Permission denied for <http://static.ak.facebook.com> to get property Proxy.InstallTrigger
Is it an error on facebook end?