0

I am trying to make an Angular web app to call SAS STP service. I have tested the page to make a 'GET' request from 'http://date.jsontest.com' and it worked perfectly. However, when I switched the URL to SAS STP service (https://server:port/SASStoredProcess/do1?_program=/Shared+Data/stp_service) it kept giving me an error saying I am not allowed.

I have tested the SAS STP service with Postman and was able to get a return successfully. do I need to deploy the STP service as Web service?

Allan Bowe
  • 12,306
  • 19
  • 75
  • 124
user3646699
  • 149
  • 4
  • 17
  • this has been incorrectly flagged as a duplicate – Allan Bowe May 18 '18 at 22:03
  • what is the exact error you receive from the SAS service? Have you deployed with streaming output? Your URL looks funny as well (`do1?` vs `do?`) – Allan Bowe May 18 '18 at 22:04
  • Take a look at this library for calling SAS services, there is also an angular seed app: https://github.com/Boemska/h54s – Allan Bowe May 18 '18 at 22:06
  • are you working locally or are your files being sent from the SAS Web Server? If local then CORS will be an issue. See: http://support.sas.com/resources/papers/proceedings17/1091-2017.pdf and the links at the bottom of this article: https://www.linkedin.com/pulse/5-tips-sas-app-developers-allan-bowe/ – Allan Bowe May 18 '18 at 22:09
  • @AllanBowe I am getting this error message: `https://server:port/SASStoredProcess/do1?_program=/Shared+Data/stp_service 403 (Forbidden)`. I have setted up the CORS on the server and using the Chrome plug in. – user3646699 May 19 '18 at 17:47
  • can you access `https://server:port/SASLogon` with your credentials? You might want to look at the logon handling in our seed app: https://github.com/Boemska/h54s-angular-seed-app – Allan Bowe May 19 '18 at 23:06
  • @AllanBowe I can login to `https://server:port/SASLogon` using my credentials. I do believe the login is the issue causing the error, it seems like it is not passing in on the POST request. I will take a look at your application and see if i can figure it out. – user3646699 May 22 '18 at 16:22
  • 1
    Just a update on how we resolved this issue. We made added the web server domain and port number in `SASMC -> Plug-Ins -> Application Management -> Configuration Manager -> Properties -> Advanced -> referrers.knownHosts ` – user3646699 May 24 '18 at 20:44
  • thanks for sharing! – Allan Bowe May 25 '18 at 07:56
  • This question should be re-opened. The issue was unrelated to CORS. I've removed the angularjs and nodejs tags. – Allan Bowe Nov 21 '19 at 13:00

0 Answers0