title: CORS blocked in wso2 identity server
body: <p>I use WSO2is 5.7.0 with my angular 6 app, i tried make api call from my app but i have a cors error: <code>Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at</code></p>
  
  <p>I already activated the cors enabled in oauth and authenticationendpoint, i edited de <code>WEB-INF/web.xml</code> of both webapps with this lines:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;filter&gt;
          &lt;filter-name&gt;CORS&lt;/filter-name&gt;
          &lt;filter-class&gt;com.thetransactioncompany.cors.CORSFilter&lt;/filter-class&gt;
  
          &lt;init-param&gt;
                  &lt;param-name&gt;cors.allowOrigin&lt;/param-name&gt;
                  &lt;param-value&gt;*&lt;/param-value&gt;
          &lt;/init-param&gt;
  &lt;/filter&gt;
  &lt;filter-mapping&gt;
    &lt;filter-name&gt;CORS&lt;/filter-name&gt;
    &lt;url-pattern&gt;*&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt;
  
  </code></pre>
  
  <p>In authenticationendpoint i copy the cors libraries from oauth to authenticationendpoint webapps in lib folder and edited the pom.xml file with this lines:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;dependency&gt;
              &lt;groupId&gt;com.thetransactioncompany.wso2&lt;/groupId&gt;
              &lt;artifactId&gt;cors-filter&lt;/artifactId&gt;
              &lt;version&gt;1.7.0.wso2v1&lt;/version&gt;
  &lt;/dependency&gt;
  
  </code></pre>
  
  <p>After this, restart the service, i and have the same problem <code>Cross-Origin Request Blocked</code></p>
  
  <p>in my angular app service i make the request as follow:</p>
  
  <pre><code>const httpHeaders = {
              headers: new HttpHeaders()
                  .set('Content-Type', 'application/x-www-form-urlencoded')
                  .set('Access-Control-Allow-Origin', '*')
          };
  
  this.http.post&lt;any&gt;(`http://localhost:9443/commonauth`, payload, httpHeaders)
  </code></pre>
  
  <p>i think is neccesary enable cors support from tomcat but i don't know how do that, What other alternatives do I have besides enabling cors?</p>
  
  <p>My sources:</p>
  
  <p><code>https://docs.wso2.com/display/IS570/Invoking+an+Endpoint+from+a+Different+Domain</code>
  <code>https://hasanthipurnima.blogspot.com/2016/05/applying-cors-filter-to-wso2-identity.html</code></p>