<?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: Can we connect SAS Viya for learners from macOS terminal via Python SWAT library? in SAS Software for Learning Community</title>
    <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Can-we-connect-SAS-Viya-for-learners-from-macOS-terminal-via/m-p/941780#M2249</link>
    <description>&lt;P&gt;After further more in-depth investigation, there is light at the end of the tunnel. &amp;nbsp; It is possible to connect to CAS via your laptop if you use https protocol but unfortunately, not with binary.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For https, you do need to do some prep work.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;You will need to extract out the public certificate.&amp;nbsp; To do this, I did the following replacing &amp;lt;server.demo.sas.com&amp;gt; with actual value:&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;echo -n | openssl s_client -showcerts -connect &amp;lt;server.demo.sas.com&amp;gt;:443 -servername &amp;lt;server.demo.sas.com&amp;gt;:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' &amp;gt; certificate.pem&lt;/P&gt;
&lt;P&gt;Ref: &lt;A href="https://sassoftware.github.io/python-swat/encryption.html" target="_blank"&gt;https://sassoftware.github.io/python-swat/encryption.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Ref: &lt;A href="https://stackoverflow.com/questions/19414832/how-can-i-pull-the-ssl-certificate-from-a-remote-server" target="_blank"&gt;https://stackoverflow.com/questions/19414832/how-can-i-pull-the-ssl-certificate-from-a-remote-server&lt;/A&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;For Viya for Learners 4, you will be using single sign on.&amp;nbsp; As a result, you will need to extract your access token:&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;On your browser, go to https://&amp;lt;server.demo.sas.com&amp;gt;/SASLogon/oauth/authorize?client_id=sas.cli&amp;amp;response_type=token&lt;/P&gt;
&lt;P&gt;Then extract out the token which is between ...access_token=&amp;lt;token which is a long base64 encoded value&amp;gt;&amp;amp;expires_in...&lt;/P&gt;
&lt;P&gt;e.g. &lt;A href="https://%3cserver.demo.sas.com%3e/SASLogon/out_of_band#token_type=bearer&amp;amp;access_token=eyJhbGciOiJSUzI1NiIsImprdSI6Imh...&amp;amp;expires_in=3599&amp;amp;scope=openid%20uaa.user&amp;amp;revocable=false&amp;amp;jti=7d03262313e84ed89395dbcda4f6" target="_blank"&gt;https://&amp;lt;server.demo.sas.com&amp;gt;/SASLogon/out_of_band#token_type=bearer&amp;amp;access_token=eyJhbGciOiJSUzI1NiIsImprdSI6Imh...&amp;amp;expires_in=3599&amp;amp;scope=openid%20uaa.user&amp;amp;revocable=false&amp;amp;jti=7d03262313e84ed89395dbcda4f6&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Then export out the token in your OS:&lt;/P&gt;
&lt;P&gt;export ACCESS_TOKEN=eyJh…&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ref: &lt;A href="https://blogs.sas.com/content/sgf/2023/02/07/authentication-to-sas-viya/" target="_blank"&gt;https://blogs.sas.com/content/sgf/2023/02/07/authentication-to-sas-viya/&lt;/A&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&amp;nbsp;In your python code:&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;import os,swat&lt;/P&gt;
&lt;P&gt;conn = swat.CAS(hostname="https://&amp;lt;server.demo.sas.com&amp;gt;/cas-shared-default-http", ssl_ca_list="./certificate.pem", password=os.environ['ACCESS_TOKEN'], protocol="https")&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hope this helps.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 29 Aug 2024 16:44:38 GMT</pubDate>
    <dc:creator>pykim</dc:creator>
    <dc:date>2024-08-29T16:44:38Z</dc:date>
    <item>
      <title>Can we connect SAS Viya for learners from macOS terminal via Python SWAT library?</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Can-we-connect-SAS-Viya-for-learners-from-macOS-terminal-via/m-p/939786#M2235</link>
      <description>&lt;P&gt;Hi, everyone&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to connect SAS Viya from my macOS terminal app via Python. It requires some confidentials, which I totally do not know what they are.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;import swat
conn = swat.CAS(hostname="http://server.demo.sas.com/cas-shared-default-http/", port=8777, username="student", password="Metadata0")&lt;/PRE&gt;
&lt;P&gt;I got the error:&lt;/P&gt;
&lt;PRE&gt;swat.exceptions.SWATError: Unable to connect to any URL: http://server.demo.sas.com/cas-shared-default-http/&lt;/PRE&gt;
&lt;P&gt;Looking forward to your suggestions. Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Source:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A title="Getting Started with Python Integration to SAS® Viya® - Part 1 - Making a Connection" href="https://blogs.sas.com/content/sgf/2020/04/15/getting-started-with-python-integration-to-sas-viya-part-1-making-a-connection/" target="_self"&gt;https://blogs.sas.com/content/sgf/2020/04/15/getting-started-with-python-integration-to-sas-viya-part-1-making-a-connection/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2024 15:30:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Can-we-connect-SAS-Viya-for-learners-from-macOS-terminal-via/m-p/939786#M2235</guid>
      <dc:creator>TomHsiung</dc:creator>
      <dc:date>2024-08-18T15:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: Can we connect SAS Viya for learners from macOS terminal via Python SWAT library?</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Can-we-connect-SAS-Viya-for-learners-from-macOS-terminal-via/m-p/940475#M2236</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/184847"&gt;@TomHsiung&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I think your issue is the server name. &lt;A href="http://server.demo.sas.com" target="_blank"&gt;http://server.demo.sas.com&lt;/A&gt;. That's normally a generic name used in documentation. You need for replace this with your SAS Viya server URL.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I spoke with someone in Education and he suggested this course:&amp;nbsp;&lt;A href="https://learn.sas.com/course/view.php?id=6021" target="_blank"&gt;https://learn.sas.com/course/view.php?id=6021&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2024 15:21:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Can-we-connect-SAS-Viya-for-learners-from-macOS-terminal-via/m-p/940475#M2236</guid>
      <dc:creator>joeFurbee</dc:creator>
      <dc:date>2024-08-22T15:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: Can we connect SAS Viya for learners from macOS terminal via Python SWAT library?</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Can-we-connect-SAS-Viya-for-learners-from-macOS-terminal-via/m-p/940491#M2237</link>
      <description>Hello, &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/214450"&gt;@joeFurbee&lt;/a&gt; Thank you for the feedback. The course material is unavailable for my account. Is it not free?</description>
      <pubDate>Thu, 22 Aug 2024 16:41:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Can-we-connect-SAS-Viya-for-learners-from-macOS-terminal-via/m-p/940491#M2237</guid>
      <dc:creator>TomHsiung</dc:creator>
      <dc:date>2024-08-22T16:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: Can we connect SAS Viya for learners from macOS terminal via Python SWAT library?</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Can-we-connect-SAS-Viya-for-learners-from-macOS-terminal-via/m-p/940495#M2238</link>
      <description>&lt;P&gt;It is unfortunately not free.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2024 14:42:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Can-we-connect-SAS-Viya-for-learners-from-macOS-terminal-via/m-p/940495#M2238</guid>
      <dc:creator>joeFurbee</dc:creator>
      <dc:date>2024-08-23T14:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: Can we connect SAS Viya for learners from macOS terminal via Python SWAT library?</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Can-we-connect-SAS-Viya-for-learners-from-macOS-terminal-via/m-p/940586#M2240</link>
      <description>&lt;P&gt;According to the document I received, I tried again to connect CAS from my python script. I manually installed SWAT 1.14.0 on my macOS. But, I got this error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;ValueError: The extensions for the binary protocol have not been installed. You can either install them using the full platform-dependent install file, or use the REST interface as an alternative.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It looks like the SWAT package 1.14.0 installed lacks something about the binary protocol extension. The REST interface uses the http protocol, which I think is not safe because of unencrypted communication. Therefore, the problem is to install the missing extensions for the binary protocol, which I don't know how. Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2024 10:56:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Can-we-connect-SAS-Viya-for-learners-from-macOS-terminal-via/m-p/940586#M2240</guid>
      <dc:creator>TomHsiung</dc:creator>
      <dc:date>2024-08-23T10:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: Can we connect SAS Viya for learners from macOS terminal via Python SWAT library?</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Can-we-connect-SAS-Viya-for-learners-from-macOS-terminal-via/m-p/940621#M2241</link>
      <description>&lt;P&gt;HiTom,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What version of python are you running?&amp;nbsp; I see &lt;A href="https://github.com/sassoftware/python-swat/issues/84" target="_blank"&gt;https://github.com/sassoftware/python-swat/issues/84&lt;/A&gt; that it is possible the latest version of python might not work with swat.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2024 14:02:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Can-we-connect-SAS-Viya-for-learners-from-macOS-terminal-via/m-p/940621#M2241</guid>
      <dc:creator>pykim</dc:creator>
      <dc:date>2024-08-23T14:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: Can we connect SAS Viya for learners from macOS terminal via Python SWAT library?</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Can-we-connect-SAS-Viya-for-learners-from-macOS-terminal-via/m-p/940625#M2242</link>
      <description>&lt;P&gt;Upon further research, I found &lt;A href="https://github.com/sassoftware/python-swat/issues/184" target="_blank"&gt;https://github.com/sassoftware/python-swat/issues/184&lt;/A&gt; which indicated&lt;/P&gt;
&lt;P&gt;"Looks like you are running Python 3.12.4. The swat package does not support Python 3.12 at this time, it only supports &amp;lt;= 3.11"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2024 14:11:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Can-we-connect-SAS-Viya-for-learners-from-macOS-terminal-via/m-p/940625#M2242</guid>
      <dc:creator>pykim</dc:creator>
      <dc:date>2024-08-23T14:11:56Z</dc:date>
    </item>
    <item>
      <title>Re: Can we connect SAS Viya for learners from macOS terminal via Python SWAT library?</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Can-we-connect-SAS-Viya-for-learners-from-macOS-terminal-via/m-p/940626#M2243</link>
      <description>Oops!  I see you contributed to that issue discussion.&lt;BR /&gt;As you indicated, go down to python 3.11 to resolve that error.</description>
      <pubDate>Fri, 23 Aug 2024 14:15:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Can-we-connect-SAS-Viya-for-learners-from-macOS-terminal-via/m-p/940626#M2243</guid>
      <dc:creator>pykim</dc:creator>
      <dc:date>2024-08-23T14:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: Can we connect SAS Viya for learners from macOS terminal via Python SWAT library?</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Can-we-connect-SAS-Viya-for-learners-from-macOS-terminal-via/m-p/940629#M2244</link>
      <description>&lt;P&gt;Sorry, I have not yet succeeded, despite the downgrading from Python 3.12 to 3.11.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After that, I was able to install SWAT 1.14.0 via pip. However, it seems this installed SWAT does not support CAS protocol, because&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;ValueError: Could not import import _py311swat. This is likely due to an incorrect SAS TK path or an error while loading the SAS TK subsystem. You can try using the REST interface as an alternative.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;I opened a SAS support case. The RESET model was also unsuccessful and I have to open the support ticket to confirm my credentials for SAS Viya. Anyway, thanks for your kind response and I will update the progress when the ticket is updated later.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Tom&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2024 14:49:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Can-we-connect-SAS-Viya-for-learners-from-macOS-terminal-via/m-p/940629#M2244</guid>
      <dc:creator>TomHsiung</dc:creator>
      <dc:date>2024-08-23T14:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: Can we connect SAS Viya for learners from macOS terminal via Python SWAT library?</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Can-we-connect-SAS-Viya-for-learners-from-macOS-terminal-via/m-p/940631#M2245</link>
      <description>&lt;P&gt;Thanks Tom for the update.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on your error, I see &lt;A href="https://sassoftware.github.io/python-swat/troubleshooting.html#unable-to-import-pyxxswat" target="_blank"&gt;https://sassoftware.github.io/python-swat/troubleshooting.html#unable-to-import-pyxxswat&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I guess I am wondering how you installed the swat package.&amp;nbsp; You indicated that you did this manually.&amp;nbsp; So pip or conda install was not used as per &lt;A href="https://sassoftware.github.io/python-swat/troubleshooting.html#unable-to-import-pyxxswat" target="_blank"&gt;https://sassoftware.github.io/python-swat/troubleshooting.html#unable-to-import-pyxxswat&lt;/A&gt; ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, please keep us informed of the SAS support case.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2024 15:00:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Can-we-connect-SAS-Viya-for-learners-from-macOS-terminal-via/m-p/940631#M2245</guid>
      <dc:creator>pykim</dc:creator>
      <dc:date>2024-08-23T15:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: Can we connect SAS Viya for learners from macOS terminal via Python SWAT library?</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Can-we-connect-SAS-Viya-for-learners-from-macOS-terminal-via/m-p/941622#M2246</link>
      <description>&lt;P&gt;Hi, I have received replies form SAS support staff. It looks like it is not possible to connect SAS Viya for Learners from python SWAT on a client.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Hi Tom,&lt;/P&gt;
&lt;P&gt;Thanks for your enquiry to SAS.&lt;/P&gt;
&lt;P&gt;SAS Viya for Learners is typically sandboxed so REST API calls outside of the environment are generally not possible.&lt;/P&gt;
&lt;P&gt;Can you please specify if you are participating in the SAS Hackathon or or what you are trying to do exactly ?&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;And&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Hey Tom,&lt;/P&gt;
&lt;P&gt;This is *** from SAS Technical Support. We've received your case *** regarding the Python access to the SAS Viya issue.&lt;/P&gt;
&lt;P&gt;The question you are inquiring about falls under concerns relating to the usage of SAS OnDemand for Academics/ SAS Viya for Learners, Unfortunately, Technical Support is limited to access assistance and unable to assist with usage issues for SAS OnDemand for Academics/ SAS Viya for Learners, as per the&amp;nbsp;&lt;A href="https://support.sas.com/ondemand/pdf/click_license.pdf" target="_blank" rel="noopener"&gt;SAS OnDemand for Academics license agreement&lt;/A&gt;, and you get trouble with software regarding usage, how do you get support?&lt;/P&gt;
&lt;P&gt;I would recommend checking out the&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Analytics-U/bd-p/sas_analytics_u" target="_blank" rel="noopener"&gt;SAS Software for Learning Community&lt;/A&gt;. The SAS Communities has wonderful resources available on our SAS Software for Learning Community for help with programming and content questions. Click&amp;nbsp;&lt;A href="https://communities.sas.com/t5/Getting-Started/How-to-get-fast-helpful-answers/ta-p/226133" target="_blank" rel="noopener"&gt;here&lt;/A&gt;&amp;nbsp;for instructions on how to get fast, helpful answers. Additionally, you may also want to consult your instructor for further usage assistance&lt;/P&gt;
&lt;P&gt;I hope this helps!&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Thu, 29 Aug 2024 04:34:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Can-we-connect-SAS-Viya-for-learners-from-macOS-terminal-via/m-p/941622#M2246</guid>
      <dc:creator>TomHsiung</dc:creator>
      <dc:date>2024-08-29T04:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: Can we connect SAS Viya for learners from macOS terminal via Python SWAT library?</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Can-we-connect-SAS-Viya-for-learners-from-macOS-terminal-via/m-p/941752#M2247</link>
      <description>&lt;P&gt;Hi Tom,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My quick investigation confirms the statement that it is sandboxed for the Viya for Learners environment.&amp;nbsp; As a result, I would recommend to use instead jupyterlab for now.&amp;nbsp; Hopefully, you have access to jupyterlab by picking "Access JupyterLab" as shown below when accessing the Viya for Learners environment.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pykim_0-1724944338056.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/99747i783A69C767252E31/image-size/medium?v=v2&amp;amp;px=400" role="button" title="pykim_0-1724944338056.png" alt="pykim_0-1724944338056.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2024 15:14:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Can-we-connect-SAS-Viya-for-learners-from-macOS-terminal-via/m-p/941752#M2247</guid>
      <dc:creator>pykim</dc:creator>
      <dc:date>2024-08-29T15:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: Can we connect SAS Viya for learners from macOS terminal via Python SWAT library?</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Can-we-connect-SAS-Viya-for-learners-from-macOS-terminal-via/m-p/941780#M2249</link>
      <description>&lt;P&gt;After further more in-depth investigation, there is light at the end of the tunnel. &amp;nbsp; It is possible to connect to CAS via your laptop if you use https protocol but unfortunately, not with binary.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For https, you do need to do some prep work.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;You will need to extract out the public certificate.&amp;nbsp; To do this, I did the following replacing &amp;lt;server.demo.sas.com&amp;gt; with actual value:&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;echo -n | openssl s_client -showcerts -connect &amp;lt;server.demo.sas.com&amp;gt;:443 -servername &amp;lt;server.demo.sas.com&amp;gt;:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' &amp;gt; certificate.pem&lt;/P&gt;
&lt;P&gt;Ref: &lt;A href="https://sassoftware.github.io/python-swat/encryption.html" target="_blank"&gt;https://sassoftware.github.io/python-swat/encryption.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Ref: &lt;A href="https://stackoverflow.com/questions/19414832/how-can-i-pull-the-ssl-certificate-from-a-remote-server" target="_blank"&gt;https://stackoverflow.com/questions/19414832/how-can-i-pull-the-ssl-certificate-from-a-remote-server&lt;/A&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;For Viya for Learners 4, you will be using single sign on.&amp;nbsp; As a result, you will need to extract your access token:&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;On your browser, go to https://&amp;lt;server.demo.sas.com&amp;gt;/SASLogon/oauth/authorize?client_id=sas.cli&amp;amp;response_type=token&lt;/P&gt;
&lt;P&gt;Then extract out the token which is between ...access_token=&amp;lt;token which is a long base64 encoded value&amp;gt;&amp;amp;expires_in...&lt;/P&gt;
&lt;P&gt;e.g. &lt;A href="https://%3cserver.demo.sas.com%3e/SASLogon/out_of_band#token_type=bearer&amp;amp;access_token=eyJhbGciOiJSUzI1NiIsImprdSI6Imh...&amp;amp;expires_in=3599&amp;amp;scope=openid%20uaa.user&amp;amp;revocable=false&amp;amp;jti=7d03262313e84ed89395dbcda4f6" target="_blank"&gt;https://&amp;lt;server.demo.sas.com&amp;gt;/SASLogon/out_of_band#token_type=bearer&amp;amp;access_token=eyJhbGciOiJSUzI1NiIsImprdSI6Imh...&amp;amp;expires_in=3599&amp;amp;scope=openid%20uaa.user&amp;amp;revocable=false&amp;amp;jti=7d03262313e84ed89395dbcda4f6&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Then export out the token in your OS:&lt;/P&gt;
&lt;P&gt;export ACCESS_TOKEN=eyJh…&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ref: &lt;A href="https://blogs.sas.com/content/sgf/2023/02/07/authentication-to-sas-viya/" target="_blank"&gt;https://blogs.sas.com/content/sgf/2023/02/07/authentication-to-sas-viya/&lt;/A&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&amp;nbsp;In your python code:&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;import os,swat&lt;/P&gt;
&lt;P&gt;conn = swat.CAS(hostname="https://&amp;lt;server.demo.sas.com&amp;gt;/cas-shared-default-http", ssl_ca_list="./certificate.pem", password=os.environ['ACCESS_TOKEN'], protocol="https")&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hope this helps.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2024 16:44:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Can-we-connect-SAS-Viya-for-learners-from-macOS-terminal-via/m-p/941780#M2249</guid>
      <dc:creator>pykim</dc:creator>
      <dc:date>2024-08-29T16:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: Can we connect SAS Viya for learners from macOS terminal via Python SWAT library?</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Can-we-connect-SAS-Viya-for-learners-from-macOS-terminal-via/m-p/941913#M2260</link>
      <description>Many thanks, &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/347089"&gt;@pykim&lt;/a&gt;&lt;BR /&gt;&lt;BR /&gt;Let me consider, hmmm.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Tom</description>
      <pubDate>Fri, 30 Aug 2024 08:09:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Can-we-connect-SAS-Viya-for-learners-from-macOS-terminal-via/m-p/941913#M2260</guid>
      <dc:creator>TomHsiung</dc:creator>
      <dc:date>2024-08-30T08:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: Can we connect SAS Viya for learners from macOS terminal via Python SWAT library?</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/Can-we-connect-SAS-Viya-for-learners-from-macOS-terminal-via/m-p/942942#M2284</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/184847"&gt;@TomHsiung&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I wrote &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Connecting-to-SAS-Viya-for-Learners-from-a-Remote-Jupyter/ta-p/942594" target="_self"&gt;a Community article&lt;/A&gt; offering two options on connecting SAS VFL from a Jupyter notebook. Hopefully, one of these solutions fits your needs.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2024 18:17:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/Can-we-connect-SAS-Viya-for-learners-from-macOS-terminal-via/m-p/942942#M2284</guid>
      <dc:creator>joeFurbee</dc:creator>
      <dc:date>2024-09-06T18:17:48Z</dc:date>
    </item>
  </channel>
</rss>

