How can I fix the Cors Enable issue in an API I created in WSO2 Integration Studio? - wso2

When I call an API that I created in Integration Studio from within a localhost application, I get a CORS error. How can I fix this.?
Although cors enabled in deployment.toml file.
[synapse_properties]
'synapse.rest.CORSConfig.enabled' = "true"
'synapse.rest.CORSConfig.Access-Control-Allow-Origin' = "*"
'synapse.rest.CORSConfig.Access-Control-Allow-Headers' = "content-type"

Related

WSO2 IS does not work after upgrade to 5.11.0

I have upgraded wso2 server from wso2 IS 5.10.0 to IS 5.11.0. I understand that there has been change in CORS, I have removed CORS filter from web.xml and added configuration to deployment.toml. I still see below two errors in logs of wso2.
ERROR {org.wso2.carbon.identity.authz.service.handler.AuthorizationHandler} - Error occurred while trying to authorize, Operation is not supported.
ERROR {org.wso2.carbon.identity.cors.valve.CORSValve} - CORS management service error when intercepting an HTTP request. org.wso2.carbon.identity.cors.mgt.core.exception.CORSManagementServiceServerException
Please guide me how to fix this errors

How to perform following changes in tomcat configuration in WSO2IS 5.9.0?

I am trying to make /oauth2/token API call from reactjs fronted and getting CORS error.
My friend asked the same question and got answer for the same also.
Please open the link for solution.
WSO2 IS returns CORS error when wrong credentials sent
But when I am trying to perform the same in WSO2IS 5.9.0 the configuration is getting overwritten to the default config.
How to perform this in 5.9.0 using deployment.toml file?
As I have mentioned in that earlier answer you need to add the given tomcat filter in the web.xml.j2 file in the path repository/resources/conf/templates/repository/conf/tomcat. The .j2 files will not get replaced by the deployment.toml at the server startup.

How to fix "Could not get any response" in Postman?

Postman for Linux
Version 6.7.1
Deepin x64
I'm trying to test a get method on postman to test my code, but I always get this error message.
Could not get any response.
There was an error connecting to localhost:3001/blocks.
Why this might have happened:
The server couldn't send a response:
Ensure that the backend is working properly
Self-signed SSL certificates are being blocked:
Fix this by turning off 'SSL certificate verification' in Settings > General
Proxy configured incorrectly
Ensure that proxy is configured correctly in Settings > Proxy
Request timeout:
Change request timeout in Settings > General
I've tried to do almost everything from this topic ("Could not get any response" response when using postman with subdomain) but nothing seems to work.
This is the on the message console.
Postman Console Message
Someone can help me to fix this?
In Postman go to Postman-> Preferences and in the settings tab turn off SSL certificate Verification
my project work try this:
Restart your web server local ex: wamp, postgree, oracle
in postman setting :
Trim keys and values in request body OFF
Use next generation URL processing ON
SSL certificate verification OFF
Always open request in web tab OFF
Send no cache header ON
Send postman token header ON
Retain headers when clicking on links OFF
Automatically follow redirects ON
Send anonymous usage data to postman OFF
It works for me:
Restart your web server like: PostgreSQL, Oracle
it will work

WSO2 Admin Console HTTP Access

I have been trying to configure the WSO2 Admin console for HTTP access and not HTTPS. I have a load balancer infant of my WSO2 ESB server that will terminate the inbound HTTPS connections and forward to the WSO2 server as HTTP.
I have tried various different configurations in the catalina-server.xml file without any success. It either does not work at all or when connecting using HTTP it simply redirects to HTTPS, even after removing the 'redirect' setting from the HTTP connector configuration.
I have spent several hours 'playing' and searching for something similar on the web to no avail.
Hopefully someone here has done something similar or can help.
Regards,
Graham
I'm using wso2 esb 4.8.1,Go to the following location in your esb carbon server ,
CARBON_HOME\repository\conf open carbon.xml file and uncomment the following line
<!-- Enable accessing Admin Console via HTTP -->
<EnableHTTPAdminConsole>true</EnableHTTPAdminConsole>
and you will have HTTP access to your wso2esb admin console. After enabling HTTP access, you can access the admin console via port 9763.

CORS issue with WSO2 API Manger 1.8.0

I am using WSO2 API manager 1.8.0.I am getting CORS issue while trying to call my secured API.I referred this link https://docs.wso2.com/display/AM180/Invoke+an+API+using+Swagger and configured my server with CORS parameters .But still i have CORS blocking issue.
You can get the Chrome extension allow-control-allow-origin or else you can get rid of the CORS issue by using this line of code.
#CrossOrigin(origins = "http://localhost:4200")
This will sort out the No 'Access-Control-Allow-Origin' header issue.