Ayyoob,

Thank you very much. Can I change the tomcat web.xml file and add the CORS 
filter to implement this requirement as a workaround?

------
Zhanwen Zhou (Jason)
+86 13922218435
[email protected]
Guangzhou Smart Cloudex Technology Co., Ltd.
Business: IOT, API Management

在 2017年6月20日,上午10:56,Ayyoob Hamza <[email protected]> 写道:

> Hi Zhanwen,
> 
> The CORS configuration in api-manager.xml is related to the synapse gateway 
> (default port 8243/8280). But the API invocation through port 9443 goes 
> through tomcat gateway(valve). Therefore the configuration change that you 
> did won't work on the alpha pack. However, this should work if you access it 
> through 8243 but you need to try this on the IoTS 3.0.0 pack since synapse 
> gateway was not supported during the alpha release. In addition app creation 
> endpoint https://<mydomain>:9443/dynamic-client-web/register/ is not 
> supported from IoTS 3.0.0 RC, instead of "dynamic-client-web/register/" we 
> have to use the endpoint given in the below curl command to create 
> application.
> 
> curl -k -X POST https://localhost:8243/api-application-registration/register 
> -H 'authorization: Basic YWRtaW46YWRtaW4=' -H 'content-type: 
> application/json' -d '{ "applicationName":"appName", 
> "tags":["device_management"]}'
> 
> Thanks
> 
> Ayyoob Hamza
> Senior Software Engineer
> WSO2 Inc.; http://wso2.com
> email: [email protected] cell: +94 77 1681010
> 
> On Tue, Jun 20, 2017 at 7:33 AM, 云展智创 <[email protected]> wrote:
> Hi team,
> 
> I had changed the api-manager.xml with the following setting, but I still got 
> the errors below:
> 
> <PastedGraphic-1.png>
> 
> XMLHttpRequest cannot load 
> https://<mydomain>:9443/dynamic-client-web/register/. 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:63342' 
> is therefore not allowed access. The response had HTTP status code 500.
> 
> I want to use the api https://<mydomain>:9443/dynamic-client-web/register/ to 
> get the client secret and client id and then to get access token with 
> oauth2/token
> 
> Could you tell me how to setup CORS in IOTS? 
> 
> Thanks.
> ------
> Zhanwen Zhou (Jason)
> +86 13922218435
> [email protected]
> Guangzhou Smart Cloudex Technology Co., Ltd.
> Business: IOT, API Management
> 
> 
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
> 
> 

_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to