I have an angular 10 application that can be opened (in an iframe) inside another application (Salesforce CRM). The external application (Salesforce CRM) passes some data to my application, but it does that as POST. How do I access this data from my application?
Asked
Active
Viewed 165 times
0
-
Does this answer your question? [How to read the post request parameters using JavaScript](https://stackoverflow.com/questions/1409013/how-to-read-the-post-request-parameters-using-javascript) – enno.void Jul 28 '21 at 09:54
-
From all the documentation I read, I understand that is not a standard way to do this. But, in my case, my angular application doesn't have a backend server (I'm using API to get the data I need). My application runs inside a CRM (Salesforce) that sends the data as post data - I think I cannot change the way Salesforce is working. Main reason for asking this question is, hopefuly, find somene that had this issue and found a way to handle it. – Zelter Ady Jul 28 '21 at 10:02
1 Answers
1
You're making a "canvas app"? (No, not <canvas>
html tag, this stuff: https://developer.salesforce.com/docs/atlas.en-us.platform_connect.meta/platform_connect/canvas_framework_intro.htm)
Iframes on steroids. And the POST you hope to read is users identity info including session id so you can read SF data via API?
Your Salesforce admin should have option in the "connected app" to send you stuff via POST ("signed request") or GET ("OAuth2 webflow").
Might be simpler for you to read the OAuth data from the url. See https://developer.salesforce.com/docs/atlas.en-us.platform_connect.meta/platform_connect/canvas_app_authentication.htm and https://salesforce.stackexchange.com/questions/29548/calling-rest-api-in-canvas-with-oauth-webflow-get

eyescream
- 18,088
- 2
- 34
- 46