You can add *CORSRequestHandler* inside the <handlers> section as below to
the *_UserInfoAPI_.xml* file in
*<APIM_HOME>/repository/deployment/server/synapse-configs/default/api/
*folder.

      <handler
class="org.wso2.carbon.apimgt.gateway.handlers.security.CORSRequestHandler">
         <property name="apiImplementationType" value="ENDPOINT"/>
         <property name="allowHeaders" value="Access-Control-Allow-Origin"/>
      </handler>

Thanks,
Naduni

On Mon, Jul 9, 2018 at 4:59 PM, Naduni Pamudika <nad...@wso2.com> wrote:

> Hi,
>
> You can refer the document [1] for enabling CORS for userinfo API.
>
> [1] https://docs.wso2.com/display/AM210/Include+
> Additional+Headers+in+the+API+Console#IncludeAdditionalHeadersintheA
> PIConsole-EnableCORSForOauthTokenApis
>
> Thanks,
> Naduni
>
> On Mon, Jul 9, 2018 at 4:49 PM, shibsankar <src...@gmail.com> wrote:
>
>> Hi ,
>>
>> I'm  getting  CORS  ERROR  in  * userinfo**  API * invocation.
>>
>>
>> Which * file / **files*  has the  CORS  configuration  in WSO2  for   
>> *userinfo
>> **API *?
>>
>>
>> Error :
>>
>> *Failed to load
>> http://xx-xx-xxx-xx-xx.xxxxxxxx.xxxxxx.xxxxxxx.com:8280/userinfo
>> <http://xx-xx-xxx-xx-xx.xxxxxxxx.xxxxxx.xxxxxxx.com:8280/userinfo>:
>> 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 <http://localhost>' is therefore not allowed
>> access.*
>>
>>
>> Regards
>> Shib
>>
>> _______________________________________________
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Naduni Pamudika*
> Software Engineer | WSO2
> Mobile: +94 719 143658 <+94%2071%20914%203658>
> [image: http://wso2.com/signature] <http://wso2.com/signature>
>



-- 
*Naduni Pamudika*
Software Engineer | WSO2
Mobile: +94 719 143658 <+94%2071%20914%203658>
[image: http://wso2.com/signature] <http://wso2.com/signature>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to