Skip to Content
0
Former Member
Mar 29, 2017 at 11:19 AM

Cross domain Issue in calling RESTful servcie for getting OAuth Client Token

261 Views

Hi,

I am facing Cross domain issue in calling Authorization service (https://localhost:9002/authorizationserver/oauth/token) for Obtaing OAuth Token using AngularJS.

Same Issue I faced in calling REST services for User scenario's. Then, I added Access-Control-Allow-Origin parameter in request Header ('Access-Control-Allow-Origin' : '*') and this parameter is restricted in Hybris CORS Filter. So that, I have added "Access-Control-Allow-Origin" parameter as SupportedHeaders under ycommercewebservice-->web-->webroot-->WEB-INF-->web.xml.

  <filter>
     <filter-name>CORS</filter-name>
     <filter-class>com.thetransactioncompany.cors.CORSFilter</filter-class>
     <init-param>
         <param-name>cors.supportedMethods</param-name>
         <param-value>GET, POST, HEAD, PUT, PATCH, DELETE, OPTIONS</param-value>
     </init-param>
     <init-param>
         <!-- fix for http://code.google.com/p/chromium/issues/detail?id=108394 -->
         <param-name>cors.supportedHeaders</param-name>
         <param-value>origin, **Access-Control-Allow-Origin**, content-type, accept, authorization</param-value>
     </init-param>
 </filter>

Is there any filter that needs to be modified like the above to solve Cross domain issue in AuthorizationServer for calling OAuth token service?