<?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 SAS 9.4M4 - Proc HTTP - Passing Cookie for Web Token Authentication in Administration and Deployment</title>
    <link>https://communities.sas.com/t5/Administration-and-Deployment/SAS-9-4M4-Proc-HTTP-Passing-Cookie-for-Web-Token-Authentication/m-p/427436#M11883</link>
    <description>&lt;P&gt;We have a situation where we need to send data to a third party server and the front end devs will be doing all sorts of magic with the data on the front end GUI. but we need to authenticate using input credentials to match those of metadata. There is a tool on the open source community that solves this, and very very well, the H54s adapter by the guys at Boemska (&lt;A href="http://boemskats.com/h54s/" target="_self"&gt;H54s&lt;/A&gt;) (&lt;A href="https://github.com/Boemska/h54s" target="_self"&gt;github h54s&lt;/A&gt;) . But for now lets say this option is not available, there are many hurdles we need to overcome on this solution, but the first is getting sas logon manager to talk to third party target server.&amp;nbsp;i have been playing around with some examples in this paper&amp;nbsp;&lt;A title="PROC HTTP" href="http://support.sas.com/resources/papers/proceedings16/SAS6363-2016.pdf" target="_self"&gt;http://support.sas.com/resources/papers/proceedings16/SAS6363-2016.pdf&lt;/A&gt;&amp;nbsp;- however there is small mention of cookies but nothing further. throughout my SAS career i've only ever dealt with web apps sitting on the mid-tier server, so i have a few questions about the &amp;nbsp;process.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Front end devs create a basic UN and PW screen with a submit button - at which point to we need to invoke a call to/from SAS?&lt;/P&gt;&lt;P&gt;Would this be easier if we used the SAS Logon Manager and the customise it?&lt;/P&gt;&lt;P&gt;what are the order of events/calls?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have been looking at this paper, which outlines things quite well.&amp;nbsp;&lt;A title="Events" href="http://documentation.sas.com/?docsetId=bisecag&amp;amp;docsetTarget=n0rhb6yftn8srbn1wqxpg2s0fzfd.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;http://documentation.sas.com/?docsetId=bisecag&amp;amp;docsetTarget=n0rhb6yftn8srbn1wqxpg2s0fzfd.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone successfully used proc http using token authentication?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i've started to play with Proc HTTP to get the location of the cookie but i'm a little unsure of where to go from here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;HTTP/1.1 201 Created
 Date: Sat, 13 Jan 2018 09:35:33 GMT
 Server: Apache-Coyote/1.1
 X-UA-Compatible: IE=edge
 Location: https://xxxx.xxxxxxxx.xxx.com/SASLogon/v1/tickets/TGT-267-OKKPHGROoeLDwX3MtnLDaIRibcsKvIFlw7TsZmcWCCdcGiNSZE-cas
 Content-Type: text/plain;charset=UTF-8
 Content-Length: 0
 Access-Control-Allow-Origin: *
 Keep-Alive: timeout=5, max=100
 Connection: Keep-Alive&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any guidance would be great - this authentication is the first but most important step as all the data drives what the user can see&amp;nbsp;at the front end.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you&lt;/P&gt;</description>
    <pubDate>Sat, 13 Jan 2018 09:41:16 GMT</pubDate>
    <dc:creator>teelov</dc:creator>
    <dc:date>2018-01-13T09:41:16Z</dc:date>
    <item>
      <title>SAS 9.4M4 - Proc HTTP - Passing Cookie for Web Token Authentication</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/SAS-9-4M4-Proc-HTTP-Passing-Cookie-for-Web-Token-Authentication/m-p/427436#M11883</link>
      <description>&lt;P&gt;We have a situation where we need to send data to a third party server and the front end devs will be doing all sorts of magic with the data on the front end GUI. but we need to authenticate using input credentials to match those of metadata. There is a tool on the open source community that solves this, and very very well, the H54s adapter by the guys at Boemska (&lt;A href="http://boemskats.com/h54s/" target="_self"&gt;H54s&lt;/A&gt;) (&lt;A href="https://github.com/Boemska/h54s" target="_self"&gt;github h54s&lt;/A&gt;) . But for now lets say this option is not available, there are many hurdles we need to overcome on this solution, but the first is getting sas logon manager to talk to third party target server.&amp;nbsp;i have been playing around with some examples in this paper&amp;nbsp;&lt;A title="PROC HTTP" href="http://support.sas.com/resources/papers/proceedings16/SAS6363-2016.pdf" target="_self"&gt;http://support.sas.com/resources/papers/proceedings16/SAS6363-2016.pdf&lt;/A&gt;&amp;nbsp;- however there is small mention of cookies but nothing further. throughout my SAS career i've only ever dealt with web apps sitting on the mid-tier server, so i have a few questions about the &amp;nbsp;process.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Front end devs create a basic UN and PW screen with a submit button - at which point to we need to invoke a call to/from SAS?&lt;/P&gt;&lt;P&gt;Would this be easier if we used the SAS Logon Manager and the customise it?&lt;/P&gt;&lt;P&gt;what are the order of events/calls?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have been looking at this paper, which outlines things quite well.&amp;nbsp;&lt;A title="Events" href="http://documentation.sas.com/?docsetId=bisecag&amp;amp;docsetTarget=n0rhb6yftn8srbn1wqxpg2s0fzfd.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;http://documentation.sas.com/?docsetId=bisecag&amp;amp;docsetTarget=n0rhb6yftn8srbn1wqxpg2s0fzfd.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone successfully used proc http using token authentication?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i've started to play with Proc HTTP to get the location of the cookie but i'm a little unsure of where to go from here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;HTTP/1.1 201 Created
 Date: Sat, 13 Jan 2018 09:35:33 GMT
 Server: Apache-Coyote/1.1
 X-UA-Compatible: IE=edge
 Location: https://xxxx.xxxxxxxx.xxx.com/SASLogon/v1/tickets/TGT-267-OKKPHGROoeLDwX3MtnLDaIRibcsKvIFlw7TsZmcWCCdcGiNSZE-cas
 Content-Type: text/plain;charset=UTF-8
 Content-Length: 0
 Access-Control-Allow-Origin: *
 Keep-Alive: timeout=5, max=100
 Connection: Keep-Alive&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any guidance would be great - this authentication is the first but most important step as all the data drives what the user can see&amp;nbsp;at the front end.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jan 2018 09:41:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/SAS-9-4M4-Proc-HTTP-Passing-Cookie-for-Web-Token-Authentication/m-p/427436#M11883</guid>
      <dc:creator>teelov</dc:creator>
      <dc:date>2018-01-13T09:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: SAS 9.4M4 - Proc HTTP - Passing Cookie for Web Token Authentication</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/SAS-9-4M4-Proc-HTTP-Passing-Cookie-for-Web-Token-Authentication/m-p/427544#M11886</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From the sound of it, you&amp;nbsp;would&amp;nbsp;be trying to authenticate against SAS from a HTTP client such as a browser-based app (or JS console) rather than PROC HTTP. I&amp;nbsp;expect&amp;nbsp;your confusion comes from the&amp;nbsp;&lt;A href="http://support.sas.com/resources/papers/proceedings16/SAS6363-2016.pdf" target="_self"&gt;paper I think you meant to link to&lt;/A&gt;, which uses PROC HTTP to show RESTful interaction with the SASLogon webapp, but only for the purposes of demonstrating the mechanism of HTTP interaction rather than any particularly useful use case in terms of app development.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I would suggest you do, if for whatever reason you choose to not go down the H54S route, is show the mechanism presented in this paper to your front end / GUI developers so that they can emulate it (&lt;A href="https://github.com/Boemska/h54s/blob/master/src/methods/methods.js#L153" target="_self"&gt;much like our adapter does&lt;/A&gt;).&amp;nbsp;To use the RESTful approach outlined in that paper they'll need to do the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Issue&amp;nbsp;a POST request to the SASLogon webapp, specifically to &lt;STRONG&gt;/SASLogon/v1/tickets&lt;/STRONG&gt;, to get a 'ticket granting ticket'. In the POST request body, include the&lt;STRONG&gt; username&amp;nbsp;&lt;/STRONG&gt;and&amp;nbsp;&lt;STRONG&gt;password&amp;nbsp;&lt;/STRONG&gt;parameters as specified by that paper.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. This 'ticket granting ticket' will be communicated back by the SASLogon app via the return headers, as the Location parameter. You can use&amp;nbsp;&lt;A href="https://www.getpostman.com/" target="_self"&gt;Postman&lt;/A&gt;&amp;nbsp;to test this yourself. Make sure that you/they set the Content-type headers to x-www-form-urlencoded for this to work. In Postman this first request looks like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="postman_firstreq.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/17836i475724552194AC7E/image-size/large?v=v2&amp;amp;px=999" role="button" title="postman_firstreq.png" alt="postman_firstreq.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;As you can see, the app returns a 'Location'&amp;nbsp;property/ in the header, as described by the paper.&amp;nbsp;Your front end developers will need to extract, using JavaScript, the&amp;nbsp;Location URL that was passed back in the response headers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Following this, they will need to issue another POST request to&amp;nbsp;the URL they extracted, this time with one parameter,&amp;nbsp;&lt;STRONG&gt;service&lt;/STRONG&gt;,&amp;nbsp;where they will specify which app endpoint they would like to be authenticated to use. If it's, for example, the Stored Process WebApp, that request will look like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="postman_secondreq1.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/17838i0A1FAA01BFDB5D4C/image-size/large?v=v2&amp;amp;px=999" role="button" title="postman_secondreq1.png" alt="postman_secondreq1.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;4. You'll notice that this request now provides a ticket ID in the Response Body. Your front end guys, again, will need to extract that ticket and append it to the URL of the target application they're looking to communicate with. You now have a ticket you can use to talk to the application you requested. Here's what that looks &amp;nbsp;the SPWA:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="postman_thirdreq.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/17839iE5746134500DBA48/image-size/large?v=v2&amp;amp;px=999" role="button" title="postman_thirdreq.png" alt="postman_thirdreq.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's it. One thing I'm not sure about is how this approach manages timeouts etc., so you may need to capture 302 redirects back to the SASLogon app when a user has been idle for long enough to time out. You may want to show your developers &lt;A href="https://github.com/Boemska/h54s/blob/master/src/methods/methods.js#L55" target="_self"&gt;how we queue any expired requests up so that they can be executed after a successful logon&lt;/A&gt; so that they can implement something similar.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just for completeness, when using&amp;nbsp;the Adapter this process involves the following JavaScript code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;adapter.&lt;FONT color="#993300"&gt;login&lt;/FONT&gt;('myusername','mypassword');&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nik&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jan 2018 19:05:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/SAS-9-4M4-Proc-HTTP-Passing-Cookie-for-Web-Token-Authentication/m-p/427544#M11886</guid>
      <dc:creator>boemskats</dc:creator>
      <dc:date>2018-01-14T19:05:05Z</dc:date>
    </item>
    <item>
      <title>Re: SAS 9.4M4 - Proc HTTP - Passing Cookie for Web Token Authentication</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/SAS-9-4M4-Proc-HTTP-Passing-Cookie-for-Web-Token-Authentication/m-p/427613#M11887</link>
      <description>Whichever we go, you have explained his perfectly and given really clear steps I need to get this off the ground.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thank you</description>
      <pubDate>Mon, 15 Jan 2018 08:01:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/SAS-9-4M4-Proc-HTTP-Passing-Cookie-for-Web-Token-Authentication/m-p/427613#M11887</guid>
      <dc:creator>teelov</dc:creator>
      <dc:date>2018-01-15T08:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: SAS 9.4M4 - Proc HTTP - Passing Cookie for Web Token Authentication</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/SAS-9-4M4-Proc-HTTP-Passing-Cookie-for-Web-Token-Authentication/m-p/433674#M12145</link>
      <description>&lt;P&gt;&lt;img id="robotvery-happy" class="emoticon emoticon-robotvery-happy" src="https://communities.sas.com/i/smilies/16x16_robot-very-happy.png" alt="Robot Very Happy" title="Robot Very Happy" /&gt;&lt;/P&gt;&lt;P&gt;Here is an example to the NOAA REST api. It looks like some want the token in the header, while others let you do things like "&amp;amp;token=..."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename response temp;&lt;BR /&gt;proc http&lt;BR /&gt;url="&lt;A href="https://www.ncdc.noaa.gov/cdo-web/api/v2/datasets" target="_blank"&gt;https://www.ncdc.noaa.gov/cdo-web/api/v2/datasets&lt;/A&gt;"&lt;BR /&gt;method= "GET"&lt;BR /&gt;out=response;&lt;BR /&gt;headers&lt;BR /&gt;"token"="YOURTOKENHERE";&lt;BR /&gt;run;&lt;BR /&gt;libname DATA JSON fileref=response;&lt;BR /&gt;Data DATA;&lt;BR /&gt;set DATA.ALLDATA;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- Bread Crumbs and Circuses for All&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2018 19:36:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/SAS-9-4M4-Proc-HTTP-Passing-Cookie-for-Web-Token-Authentication/m-p/433674#M12145</guid>
      <dc:creator>mich1</dc:creator>
      <dc:date>2018-02-02T19:36:52Z</dc:date>
    </item>
  </channel>
</rss>

