BookmarkSubscribeRSS Feed
LukeW21
Calcite | Level 5

Hello,

 

This is my first time working with stored processes. I've created a SAS Stored Process that when sent an HTTP GET request is meant to return a JSON file. This has worked on the SAS Web Application, and when using a PROC HTTP GET request. However, when I attempt to use Postman, or a Curl request from Git Bash, the stored process returns an empty file or nothing at all. The source of this seems to be that the request is being redirected to the login manager, as evidenced when I issue the following command from Git Bash:


 

curl -u "username@password"   -H "Accept: application/json"   -v   "https://sasmid02i.iso-ne.com:8343/SASStoredProcess/do1?_program=/MMA/IAM_SAS_Metadata_API&_action=execute"

 

 

I get the following log / output telling me how the operation proceeded:

 

 

* Host sasmid02i.iso-ne.com:8343 was resolved.
* IPv6: (none)
* IPv4: 10.145.15.132
*   Trying 10.145.15.132:8343...
* schannel: disabled automatic use of client certificate
* ALPN: curl offers http/1.1
* ALPN: server accepted http/1.1
* Established connection to sasmid02i.iso-ne.com (10.145.15.132 port 8343) from 10.145.166.168 port 64294
* using HTTP/1.x
* Server auth using Basic with user '<username>'
> GET /SASStoredProcess/do1?_program=/MMA/IAM_SAS_Metadata_API&_action=execute HTTP/1.1
> Host: sasmid02i.iso-ne.com:8343
> Authorization: Basic <encodedPassword>=
> User-Agent: curl/8.16.0
> Accept: application/json
>
* schannel: remote party requests renegotiation
* schannel: renegotiating SSL/TLS connection
* schannel: SSL/TLS connection renegotiated
* schannel: remote party requests renegotiation
* schannel: renegotiating SSL/TLS connection
* schannel: SSL/TLS connection renegotiated
* Request completely sent off
< HTTP/1.1 302
< Date: Fri, 05 Dec 2025 12:49:59 GMT
< Server: Apache
< Cache-Control: no-cache, no-store, max-age=0, must-revalidate
< Pragma: no-cache
< Expires: 0
< Strict-Transport-Security: max-age=31536000
< X-XSS-Protection: 1; mode=block
< X-Frame-Options: SAMEORIGIN
< X-Content-Type-Options: nosniff
< Location: https://sasmid02i.iso-ne.com:8343/SASLogon/login?service=https%3A%2F%2Fsasmid02i.iso-ne.com%3A8343%2FSASStoredProcess%2Flogin%2Fcas&direct_authentication_ticket=ST-3691-NQdLiB94DSq5aAViIj1r-tsNxK8-sasmid02i
< Content-Length: 0
< Set-Cookie: 64c1c16f3eff9797ee0bb639b54ba517_Cluster1=E87992C261AEA34B9CFEBB2B9945405B.64c1c16f3eff9797ee0bb639b54ba517_SASServer1_1; Path=/SASStoredProcess; Secure; HttpOnly
< Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' *.sas.com; img-src 'self' *.sas.com blob: data:; style-src 'self' 'unsafe-inline'; child-src 'self' blob: data: mailto:; connect-src 'self' *.sas.com; frame-ancestors 'self'; font-src 'self' data:;
<
* Connection #0 to host sasmid02i.iso-ne.com:8343 left intact

 

 

The lines "HTTP/1.1 302" and "Location: https://sasmid02i.iso-ne.com:8343/SASLogon/login?service=..."  tell me that I am being redirected to a login page.

 

I am looking through management console, and I have configured both the Stored Process Web App to accept basic authentication and direct credentials:

LukeW21_1-1764939392660.png

 

As well as in the Logon Manager:

LukeW21_2-1764939441486.png

 

I also even checked that my web.xml configuration file has a /do1 servlet mapping:

LukeW21_3-1764939496742.png

 

I've restarted the mid tier server as well after making the changes to allow for basic authentication, and am now at a bit of a loss as to next steps to make this program work. 

 

For the sake of providing as much information as possible, here is the code meant to take the dataset I've created from SAS metadta and generate a JSON file:

%macro json_output; 
 
  data _null_; 
   rc = stpsrv_header('Content-type','application/json'); 
   rc = stpsrv_header('Content-disposition','attachment; filename=iam_sas_metadata.json'); 
  run; 
 
 
  proc json out= _WEBOUT pretty; 
    export sas_users; 
  run; 
 
%mend json_output; 

Does anybody have any thoughts on to what might be causing the basic authentication redirect to still occur? The program itself accesses a database and then scrapes metadata from the metadata server to give an account of users and their roles to be sent out in the JSON file.

 

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 0 replies
  • 81 views
  • 0 likes
  • 1 in conversation