0

I am facing issue in connecting the angular to salesforce for getting the access token

When i try this through postman it working fine . but when i try this through angular i am getthing following error message

Access to XMLHttpRequest at 'https://bts--tnew.my.salesforce.com/services/data/v46.0/chatter/feed-elements/' from origin 'https://bts-client.herokuapp.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

here is my angular screen

enter image description here

enter image description here

enter image description here

enter image description here enter image description here

Our rest of the feed is working fine when we generate access_token from postman.

but when i try to generated access_token at run time we are getting cors origin issue

Please suggest, is there any configuration i miss to configure ?

0

You need to set an HTTP header in your Heroku app like this:

Access-Control-Allow-Origin: *
| improve this answer | |
  • This header is already exist in it , please check angular code – Ashish Nigam Nov 6 '19 at 2:02
  • Application is working fine, but only chatter part create this issue. – Ashish Nigam Nov 6 '19 at 2:06
  • Your current value is this Access-Control-Allow-Origin: bts.herokuapp.com, please change it to a star and retry – Bryan Anderson Nov 6 '19 at 13:55
  • I tried both options Access-Control-Allow-Origin: * and Access-Control-Allow-Origin: bts.herokuapp.com but it won't work – Ashish Nigam Nov 8 '19 at 10:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.