BookmarkSubscribeRSS Feed
Obsidian | Level 7

I have followed the directions of Chris Hemedinger and Joseph Henry for retrieving the token needed for interacting with SharePoint and OneDrive.  I have an Azure API with a client secret. 


I am trying to figure out how to best lock down the value of the client_secret and yet have it accessible to the users of my environment so that they can utilize the API calls from SAS to o365 SharePoint Online.


What is the recommended method to hide this value?


I thought of a %include, but that needs to be readable for their code to work.  I thought of burying a macro value but any savvy user would know %put &thesecret. ; in a SAS session would show the literal value.


Thank you in advance for sharing your thoughts and experiences in this thread.

Fluorite | Level 6

Can you share any additional information about your SAS environment? version? platform? my first instinct would be looking at a metadata object. However, that would assume a SAS installation that included a metadata server.

Obsidian | Level 7

I have a 3-Tier (non-grid) Linux set up.  RHEL 7, SAS 9.4m6.


So, yes, I have a metadata tier. 



Obsidian | Level 7
If you can use a user/password to authenticate, you can store that into an AuthDomain in your meta, and call your API through a "proc http" with an Authdomain parameter.
If the client ID is a parameter of the request, you can encapsulate your code (proc http or curl), into a stored compile AND secure macro :
%macro MP_MACRO / store secure ;
%local mv_secret ;

proc http .....

%mend ;

with this, end users can not have the secret !



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

Discussion stats
  • 3 replies
  • 1 like
  • 3 in conversation