Hi everyone,
I would have some questions about how to connect to CAS via SWAT. I am a system administrator and for security reasons we do not like that users passwords are written in the code or put in some file on the client (although they are entered in a protected .authinfo).
Are there other ways to allow authentication to CAS, perhaps through a prompt or integration with LDAP?
Thanks
Davide
@Mena11 ,
You could encode your password in .authinfo file, please see the instructions here https://go.documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.5&docsetId=authinfo&docsetTarget=.... If you still do not want to use .authinfo file, then you could provide username and password in your program, for example here is what you can use in Python SWAT:
import swat conn = swat.CAS(host, port, username, password)
Adding to the comment from @SundareshS. While not a specific SWAT example, in section 1.2 of this SASGF 2020 paper from @anbout , Ten Minutes to Your First Hello World: REST APIs, outlines how to use getPass(). The accompanying Jupyter notebook is located in the supporting GitHub repository.
Join us for SAS Community Trivia
SAS Bowl XLIII, The New SAS Developer Portal
Wednesday, August 14, 2024, at 10 a.m. ET | #SASBowl
Hey @joeFurbee , thanks for the mention. I have also used getpass() with SWAT just like I did in my SGF paper that you mentioned. I would suggest that you might want too review how I have used it ... including the command to reset the pw variable to Null immediately after use. If you just use getpass() to prompt without the additional steps, then the variables will remain actively assigned and could be printed or otherwise called.
Also, while I am on this topic, in order to secure the connections for SWAT, I ended up installing JupyterHub co-located with my Viya installation so that I could reference the security certs co-located on the Linux host without having to do any certificate distribution to workstations.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.