After further more in-depth investigation, there is light at the end of the tunnel. It is possible to connect to CAS via your laptop if you use https protocol but unfortunately, not with binary.
For https, you do need to do some prep work.
You will need to extract out the public certificate. To do this, I did the following replacing <server.demo.sas.com> with actual value:
echo -n | openssl s_client -showcerts -connect <server.demo.sas.com>:443 -servername <server.demo.sas.com>:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > certificate.pem
Ref: https://sassoftware.github.io/python-swat/encryption.html
Ref: https://stackoverflow.com/questions/19414832/how-can-i-pull-the-ssl-certificate-from-a-remote-server
For Viya for Learners 4, you will be using single sign on. As a result, you will need to extract your access token:
On your browser, go to https://<server.demo.sas.com>/SASLogon/oauth/authorize?client_id=sas.cli&response_type=token
Then extract out the token which is between ...access_token=<token which is a long base64 encoded value>&expires_in...
e.g. https://<server.demo.sas.com>/SASLogon/out_of_band#token_type=bearer&access_token=eyJhbGciOiJSUzI1NiIsImprdSI6Imh...&expires_in=3599&scope=openid%20uaa.user&revocable=false&jti=7d03262313e84ed89395dbcda4f6
Then export out the token in your OS:
export ACCESS_TOKEN=eyJh…
Ref: https://blogs.sas.com/content/sgf/2023/02/07/authentication-to-sas-viya/
In your python code:
import os,swat
conn = swat.CAS(hostname="https://<server.demo.sas.com>/cas-shared-default-http", ssl_ca_list="./certificate.pem", password=os.environ['ACCESS_TOKEN'], protocol="https")
Hope this helps.
... View more