Forum Discussion
SharePoint PnP Webcast - Calling external APIs securely from SharePoint Framework
Love these informative and easy to follow WebCasts, I only wish there were more, not at all taking away from the astounding load of content you guys put out! Some of it is just a little bit ahead of my game :/
Could someone instruct me on the best practices for contacting an external API, for which the user would input an authentication key?
I'm using "this.context.httpClient.get()" to get a user specific list of objects from a third party web service. During runtime I'm getting hit by some CORS errors (I believe) the error I get is:
"Response to preflight request doesn't pass access control check: No
'Access-Control-Allow-Origin' header is present on the requested resource."
Is there some SP specific way of handling this or just any solution in general, I am new to this and didn't realize this could be a problem before I got hit with the error :/
EDIT:
I just got a response from the serivce and they do not support client side calls, would the best course be utilizing azure functions or no? Again any and all input appreciated :)
Thanks in advance,
-Ketill