<?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: SAS Soap Service combined password in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Soap-Service-combined-password/m-p/427704#M68467</link>
    <description>&lt;P&gt;SAS has a SHA256 function, but (as far as I know) does not have a SHA1 function.&amp;nbsp;&amp;nbsp;This topic thread shows &lt;A href="https://communities.sas.com/t5/Base-SAS-Programming/Enable-SHA1-Hash-MessageDigest-in-SAS-with-Javaobj/td-p/28315" target="_self"&gt;how to call SHA1 in PROC Groovy&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you have that, you can combine and implement the Base64 part with the $BASE64 format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
 length nonce $ 50 created $ 28 password $ 25 
        value $ 256 sha1val $ 256;
 nonce = "nonce-value";
 /* datetime in SOAP XML string format */
 /* TODO: verify proper ISO format for this */
 created = put(datetime(),is8601dz.); 
 password = "password";
 value = cats(nonce, created, password);

 /* TBD: add step to SHA1 encode */
 sha1val = value;

 call symput('credential', put(trim(sha1val), $BASE64x256.));
run;

%put &amp;amp;credential;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Example out:&lt;/P&gt;
&lt;PRE&gt;40         %put &amp;amp;credential;
bm9uY2UtdmFsdWUyMDE4LTAxLTE1VDA5OjM5OjEzKzAwOjAwcGFzc3dvcmQ=&lt;/PRE&gt;</description>
    <pubDate>Mon, 15 Jan 2018 14:40:46 GMT</pubDate>
    <dc:creator>ChrisHemedinger</dc:creator>
    <dc:date>2018-01-15T14:40:46Z</dc:date>
    <item>
      <title>SAS Soap Service combined password</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Soap-Service-combined-password/m-p/427693#M68465</link>
      <description>&lt;P&gt;Hy,&lt;/P&gt;&lt;P&gt;I have a SOAP Webservice i have to access. The Problem is that i need to send a Password thats combined with some hashes and other fields.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i need to send the following password:&lt;BR /&gt;&lt;EM&gt;Password_Digest = Base64 ( SHA-1 ( nonce + created + password ) )&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;nonce = the Request ID&lt;/P&gt;&lt;P&gt;created = the timestamp&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know its possible to create a Base64 Hash and a SHA-1 hash (with an extra java Programm) but how do i get the Request ID and the Timestamp of my Request?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it even possible to get this information in SAS or do i have to make a JAVA-Programm which does the soap stuff?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;BR /&gt;DGKK&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jan 2018 14:05:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Soap-Service-combined-password/m-p/427693#M68465</guid>
      <dc:creator>DGKK</dc:creator>
      <dc:date>2018-01-15T14:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Soap Service combined password</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Soap-Service-combined-password/m-p/427704#M68467</link>
      <description>&lt;P&gt;SAS has a SHA256 function, but (as far as I know) does not have a SHA1 function.&amp;nbsp;&amp;nbsp;This topic thread shows &lt;A href="https://communities.sas.com/t5/Base-SAS-Programming/Enable-SHA1-Hash-MessageDigest-in-SAS-with-Javaobj/td-p/28315" target="_self"&gt;how to call SHA1 in PROC Groovy&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you have that, you can combine and implement the Base64 part with the $BASE64 format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
 length nonce $ 50 created $ 28 password $ 25 
        value $ 256 sha1val $ 256;
 nonce = "nonce-value";
 /* datetime in SOAP XML string format */
 /* TODO: verify proper ISO format for this */
 created = put(datetime(),is8601dz.); 
 password = "password";
 value = cats(nonce, created, password);

 /* TBD: add step to SHA1 encode */
 sha1val = value;

 call symput('credential', put(trim(sha1val), $BASE64x256.));
run;

%put &amp;amp;credential;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Example out:&lt;/P&gt;
&lt;PRE&gt;40         %put &amp;amp;credential;
bm9uY2UtdmFsdWUyMDE4LTAxLTE1VDA5OjM5OjEzKzAwOjAwcGFzc3dvcmQ=&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Jan 2018 14:40:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Soap-Service-combined-password/m-p/427704#M68467</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2018-01-15T14:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Soap Service combined password</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-Soap-Service-combined-password/m-p/427944#M68493</link>
      <description>&lt;P&gt;Hy,&lt;/P&gt;&lt;P&gt;thanks for your answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the actual problem i have is neither the base64 nor the sha-1 encryption.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's more the problem how can i use those fields (timestamp, Request-ID) in the proc soap;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is it possible to use proc soap if those fileds are unique for every request?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SOAP IN = %requestFile
	OUT = %responseFile
	URL = "%url"
	SOAPACTION = "%action"
	WSSUSERNAME = "%user"
	WSSPASSWORD = "%generatePassword(timestamp, requestID)"

;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;in this example how do i get the fields timestamp and requestID?&lt;/P&gt;&lt;P&gt;Note: timestamp is created by the server and can not be generated with datetime()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and Greets&lt;/P&gt;&lt;P&gt;DGKK&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2018 08:40:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-Soap-Service-combined-password/m-p/427944#M68493</guid>
      <dc:creator>DGKK</dc:creator>
      <dc:date>2018-01-16T08:40:22Z</dc:date>
    </item>
  </channel>
</rss>

