BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
RobP
Quartz | Level 8

I have a simple "Hello World" stored process, and I can successfully call it from my browser and get the results directly by passing in my user/pass credentials as part of the URL request (so the login page never shows).

 

I'm trying to replicate the above behaviour by passing the same URL to curl, but I keep getting the login screen as a result.

 

From the browser, the URL looks like:

 

http://myserver.com:7980/SASStoredProcess/do?
_program=my_program&_username=my_user_name&_password=%7BSAS002%7DEFFF...

 

From curl (running from a Linux64 bash shell), I've tried a multitude of parameters etc, but my latest version is:

 

curl -v -L -k -d "_program=my_program&_username=my_user_name&_password=%7BSAS002%7DEFFF..."  
http://myserver.com:7980/SASStoredProcess/do

As I mentioned, it results in the login screen.  I've also tried the /do1 request with the same results. 

 

I believe I have everything configured correctly in SAS Management Console, as the request works fine from the browser URL.  Where am I going wrong?

1 ACCEPTED SOLUTION

Accepted Solutions
AllanBowe
Barite | Level 11

You're just missing the options to read / write cookies (this is where the session token is stored).  

 

Try the following:

 

curl -v -L -k -c cookiefile -b cookiefile \
-d "_program=my_program&_username=my_user_name&_password=%7BSAS002%7DEFFF..." \
http://myserver.com:7980/SASStoredProcess/do

 

/Allan
SAS Challenges - SASensei
MacroCore library for app developers
SAS networking events (BeLux, Germany, UK&I)

Data Workflows, Data Contracts, Data Lineage, Drag & drop excel EUCs to SAS 9 & Viya - Data Controller
DevOps and AppDev on SAS 9 / Viya / Base SAS - SASjs

View solution in original post

2 REPLIES 2
AllanBowe
Barite | Level 11

You're just missing the options to read / write cookies (this is where the session token is stored).  

 

Try the following:

 

curl -v -L -k -c cookiefile -b cookiefile \
-d "_program=my_program&_username=my_user_name&_password=%7BSAS002%7DEFFF..." \
http://myserver.com:7980/SASStoredProcess/do

 

/Allan
SAS Challenges - SASensei
MacroCore library for app developers
SAS networking events (BeLux, Germany, UK&I)

Data Workflows, Data Contracts, Data Lineage, Drag & drop excel EUCs to SAS 9 & Viya - Data Controller
DevOps and AppDev on SAS 9 / Viya / Base SAS - SASjs
RobP
Quartz | Level 8

Yes! That was it... thank you so much!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1404 views
  • 4 likes
  • 2 in conversation