I am using WSO2 API Manager version 4.1.0. In this, CORS configuration is not working even though all the configurations were made.
Note : I am not using WSO2 Identity server , only using API Manager.
I made the below configurations,
Deployment.toml file :
[apim.cors]
enable = true
allow_origins = "*"
allow_methods = ["GET","PUT","POST","DELETE","PATCH","OPTIONS"]
allow_headers = "*"
allow_credentials = false
under the path "/repository/deployment/server/synapse-configs/default/api" in OpenService.xml made the below changes as I couldnt find TokenAPI.xml only OpenService.xml were there in this version,
<handler class="org.wso2.carbon.apimgt.gateway.handlers.security.CORSRequestHandler">
<property name="apiImplementationType" value="ENDPOINT"/>
</handler>
Even after making these changes , facing below error,
Access to XMLHttpRequest at 'https://11.22.333.44:9443/oauth2/token' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Can someone help with this.