<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Send PROC HTTP  Request through Stored Process in Administration and Deployment</title>
    <link>https://communities.sas.com/t5/Administration-and-Deployment/Send-PROC-HTTP-Request-through-Stored-Process/m-p/809675#M24244</link>
    <description>The Stored Process Server typically runs as a shared account (sassrv). You would probably need to run the code in a Workspace Server which runs as the requesting user on the server to use AUTH_NEGOTIATE, assuming you are connecting using single signon (SSO).&lt;BR /&gt;&lt;BR /&gt;Are your users using SSO to connect to SAS before running this code? Does the code run successfully in a Workspace Server (i.e. SAS Studio, Enterprise Guide)? If so, could you change the stored process server properties to tell it to run as a workspace server instead?</description>
    <pubDate>Mon, 25 Apr 2022 12:41:31 GMT</pubDate>
    <dc:creator>gwootton</dc:creator>
    <dc:date>2022-04-25T12:41:31Z</dc:date>
    <item>
      <title>Send PROC HTTP  Request through Stored Process</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Send-PROC-HTTP-Request-through-Stored-Process/m-p/809485#M24237</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to send a POST API request using&amp;nbsp;PROC HTTP through a Stored Process (UI),&lt;/P&gt;
&lt;P&gt;Since the user is already logged in, I want to use the same credentials instead of writing the username and password in \&lt;/P&gt;
&lt;PRE&gt;/* Send http request from Stored Process */
PROC HTTP 
 METHOD="POST"
 URL="http://application-name/SASComplianceSolutionsMid/.../...."
 CT="application/json"
 IN=input
 OUT=output
 &lt;STRONG&gt;WEBUSERNAME&lt;/STRONG&gt;="username"
 &lt;STRONG&gt;WEBPASSWORD&lt;/STRONG&gt;="password"								
 /* AUTH_NEGOTIATE */
; 
RUN;&lt;/PRE&gt;
&lt;P&gt;However this code responds with &lt;STRONG&gt;HTTP Status 403 - Forbidden&lt;/STRONG&gt;, not sure about the reason&lt;STRONG&gt;,&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also tried to use the AUTH_NEGOTIATE option instead of the basic authentication option, but it didn't work as expected and it returns &lt;STRONG&gt;HTTP Status &lt;/STRONG&gt;&lt;STRONG&gt;401 - Unauthorized Access&lt;/STRONG&gt;. I expected that it will use the same credentials for the logged-in user.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;EM&gt;HTTP Negotiate is an authentication extension that is used commonly to provide single signon capability to web requests. This is normally used in PROC HTTP when a password is not&amp;nbsp;&lt;/EM&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;EM&gt;provided, since it will use the current user’s identity for authentication.&amp;nbsp;&lt;A href="https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/3232-2019.pdf" target="_blank" rel="noopener"&gt;Link&lt;/A&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Am I missing something? Or is it applicable to send the API request in such a way without determining a specific credential in the code?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Apr 2022 12:47:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Send-PROC-HTTP-Request-through-Stored-Process/m-p/809485#M24237</guid>
      <dc:creator>s210</dc:creator>
      <dc:date>2022-04-24T12:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: Send PROC HTTP  Request through Stored Process</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Send-PROC-HTTP-Request-through-Stored-Process/m-p/809500#M24238</link>
      <description>&lt;P&gt;What does the stored process log say.?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS stored process is inherently a SAS program. You can add a statement to output the log to a specific location like the following&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc printto print='The full path and name of log file' new;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Please post the log.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Apr 2022 14:53:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Send-PROC-HTTP-Request-through-Stored-Process/m-p/809500#M24238</guid>
      <dc:creator>Sajid01</dc:creator>
      <dc:date>2022-04-24T14:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: Send PROC HTTP  Request through Stored Process</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Send-PROC-HTTP-Request-through-Stored-Process/m-p/809675#M24244</link>
      <description>The Stored Process Server typically runs as a shared account (sassrv). You would probably need to run the code in a Workspace Server which runs as the requesting user on the server to use AUTH_NEGOTIATE, assuming you are connecting using single signon (SSO).&lt;BR /&gt;&lt;BR /&gt;Are your users using SSO to connect to SAS before running this code? Does the code run successfully in a Workspace Server (i.e. SAS Studio, Enterprise Guide)? If so, could you change the stored process server properties to tell it to run as a workspace server instead?</description>
      <pubDate>Mon, 25 Apr 2022 12:41:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Send-PROC-HTTP-Request-through-Stored-Process/m-p/809675#M24244</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2022-04-25T12:41:31Z</dc:date>
    </item>
    <item>
      <title>Re: Send PROC HTTP  Request through Stored Process</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Send-PROC-HTTP-Request-through-Stored-Process/m-p/810103#M24266</link>
      <description>&lt;P&gt;Rather than use proc http, why don't you connect to the service from the frontend using JavaScript?&amp;nbsp; Users can then provide the necessary credentials (or use SSO).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can serve the javascript from your Stored Process, but I wouldn't recommend writing the "put" statements yourself.&amp;nbsp; You could try the streaming app approach my team have built - here's an overview:&amp;nbsp;&amp;nbsp;&lt;A href="https://sasapps.io/sas-streamed-apps" target="_blank"&gt;https://sasapps.io/sas-streamed-apps&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2022 10:34:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Send-PROC-HTTP-Request-through-Stored-Process/m-p/810103#M24266</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2022-04-27T10:34:29Z</dc:date>
    </item>
  </channel>
</rss>

