+ Start a Discussion
Arun ppArun pp 

CORS issue when trying to access services/oauth2/token?code= endpoint

Hi ,
I use an angular js app which is doing an ajax call on services/oauth2/token?code= endpoint but this fails and gives an error saying 
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://sunsso6.cloud.pcftest.com' is therefore not allowed access.
And when i tried a CORS plugin this worked but checking out for an actual solution so that it works without CORS plugin in chrome browser.

_Zach Boyd_Zach Boyd
Try and go to Setup | Security Controls | CORS -> New in your Salesforce org and whitelist https://sunsso6.cloud.pcftest.com. Rerun your test to see if that works.
Arun ppArun pp
Hi Zack thank you for the suggestion i have tried the above CORS whitelisting . did not work for me any other direction which i need to take ?
_Zach Boyd_Zach Boyd
Is the angularjs app on https://sunsso6.cloud.pcftest.com and trying to call into Salesforce, or does it live in Salesforce and you are trying to call into https://sunsso6.cloud.pcftest.com?
Arun ppArun pp
This Angular app lives outside of salesforce