My UI page keeps on loading when I try to perform a click operation. Which in return needs to fetch data using API call in the back end and display it in UI. Attached screenshot for reference.
Access to XMLHttpRequest at 'https://idp2.renault.com/nidp//app/login?target=https%3A%2F%2Fidp2.renault.com%2Fnidp%2Foauth%2Fnam%2Fauthz%3Fresponse_type%3Dcode%26scope%3Dopenid%2Bemail%2Bopenid%2Barca%2Brole-eic-irn65553%26client_id%3Da6a57638-bb90-49b8-b11b-862c9824fa13%26state%3DhGLwfzSpJOUeEw1dk5GOnFfN5L8%26redirect_uri%3Dhttps%3A%2F%2Feic-app2.dev1.applis.renault.fr%3A443%2Fauth%2Foidc%26nonce%3DFiGw4mp9izHujzUrQVgEA7q9SOwUETofvF-5kDVqZqg%26resourceServer%3DIdentityProvider' (redirected from 'https://eic-app2.dev1.applis.renault.fr/assets/i18n/fr.json') from origin 'https://eic-app2.dev1.applis.renault.fr' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource
I had the very same issue with the same error message. My symfony php backend is running locally in docker. XDebug is also installed. Following 2 lines in the backend resolved this issue and I was finally able to login.
touch /var/www/html/xdebug.log
chmod 777 /var/www/html/xdebug.log
Related
Ok, I hope I am not making a duplicate but my question is a bit different from most of the result for CORS questions.
I have springboot rest api backend and I have reactJs frontend using Axios.
on my API interface I added
#CrossOrigin(origins = {"http://localhost:3000", "http://localhost"})
#RequestMapping ...
...
Locally everything is running fine.
React running on http://localhost:3000
api running on http://localhost:8080/apixxx/orders
So I deployed them on my ubuntu server:
React running on http://12.123.12.123 (port is 80)
api running on http://12.123.12.123:8080 (postman requests are successful)
Now see, I put #CrossOrigin origin of "http://localhost" because that is for the deployed copy of my API, since relative to the server it is localhost.
Now I am getting:
Access to XMLHttpRequest at 'http://localhost:8080/apireq/v1/apiresourcexx' from origin 'http://12.123.12.123' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
this is the same error I get locally when I remove the #CrossOrigin.
I tried adding in the origins "http://12.123.12.123", "http://12.123.12.123:80", "http://myDomainName.com" (my domain name), "http://myDomainName.com:80".
Nothing works. Still the same error.
What I found works is:
#CrossOrigin(origins = {"*"})
But I dont want to do that....
Please help.
-----UPDATE-----
Ok, I am really confused now.
Apparently, I just realized that the axios routing I used is axios.post('http://localhost:8080/apixxx/orders', ...); And basically this will point to the springboot running on my local machine, not on the prod server. If that is the case, then each of my client will be different origin and all of them will be calling my API... If that is the case then the only solution is that one I am avoiding: #CrossOrigin(origins ="*")
Please advise. What do you guys usually do in this situaion.
I'm currently developing a custom app that needs to be deployed on the eu1.rallydev.com server.
During the development I would like to use the App-debug.html to quickly see code changes without having to build and paste new html code, but this doesn't work.
I've changed the "server" in config.json, but keeps getting an error in console
Failed to load resource: the server responded with a status of 403 ()
Does anyone know what else I should do?
Try checking if the sysadmin has blocked the Custom HTML app in the subscription settings:
Allow Custom HTML app: true
Enable Cross-Origin Resource Sharing: true
I'm implementing the Okta signin widget with React Native
I get this:
Failed to load https://dev-827074.oktapreview.com/api/v1/sessions/me: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access.
After trying to login, I get the following:
UnsupportedBrowserError {name: "UNSUPPORTED_BROWSER_ERROR", message: "There was an error sending the request - have you enabled CORS?"}
We've received similar errors from Okta. What we had to do is add the hostname for the server that hosts the webview as a Trusted Origin.
API -> Trusted Origins -> Add Origin
You can add multiple origins, you probably need to add http://localhost:3000.
You may need to add http://localhost:3000/implicit/callback to your app's Login Redirect URI's in the General Settings of your Okta app
The API you have written does not support CORS. CORS or Cross origin resource sharing allows a web app to submit requests to an API belonging to a different domain. This setting should be enabled on the API side.
This is how it works, whenever a request is sent to a different domain, an OPTIONS method is sent to the server. The server responds back with available options for the web app. If the verb is supported, the browser will send the actual request with the appropriate verb or method (For example, GET or POST). If the verb is not supported, you get the above error message.
In short, enable CORS for your API. If it is a Node / Express API it is just a simple cors package you need to add to your project and use.
I have recently installed the latest version of the base app from codeplex (2sic_2SexyContent_08.04.08_Install.zip ) to DNN vesion 7.4.0, created a new admin page and added the module there.
from there I have tried to add a new app (2sxcApp_GoogleTagManager_01.00.01.zip) and the install pop up flashes for a split second then nothing happens.
checking the console I see;
/desktopmodules/tosic_sexycontent/dist/dnn/ui.html?sxcver=8.4.8.19191#zoneI…true&user%5BcanDevelop%5D=true&approot=%2F&dialog=dash-view&items=%5B%5D:1 XMLHttpRequest cannot load http://northcityosteopaths.co.nz/desktopmodules/2sxc/api/view/Module/GetSelectableApps. Response for preflight is invalid (redirect)
/desktopmodules/tosic_sexycontent/dist/dnn/ui.html?sxcver=8.4.8.19191#zoneI…rue&user%5BcanDevelop%5D=true&approot=%2F&dialog=app-import&items=%5B%5D:1 XMLHttpRequest cannot load http://northcityosteopaths.co.nz/desktopmodules/2sxc/api/app/ImportExport/ImportApp. Response for preflight is invalid (redirect)
enter image description here
I have tried reinstalling the base module and recycling the app pool
have also set page skin to default Gravity skin.
I'm trying to make a GET request from an iPhone app(built on Worklight), to a remote worklight adapter on a remote server.
I have generated the authorization request header using the following
http://remote-url:port/project/authorization/v1/testtoken
However, I keep getting the following cross domain error:
XMLHttpRequest cannot load https://remote-url/project/adapters/call/mq/getAccounts/22. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://myapp-url:port' is therefore not allowed access.
But, when I try do the same GET request using an API tool like Postman, I receive the results no issues on my browser.
First - testtoken is only available from the MobileFirst Studio development environment... you need to take this into consideration.
Second, you're likely using Chrome and Crome disallows CORS by default. Change your browser settings and/or try in a different browser.