Hi Chris, good idea.
I tried this instead of the last proc http step (see Post 8):
/* try to get folder entities - just to try a GET method Microsoft API documentation: url: http://site url/_api/web/GetFolderByServerRelativeUrl('/Shared Documents') method: GET headers: Authorization: "Bearer " + accessToken accept: "application/json;odata=verbose" or "application/atom+xml" For Proc HTTP: url="http://&base_url./sites/_api/web/GetFolderByServerRelativeUrl('/Shared Documents')" */ proc http method='GET' url="http://&base_url./sites/_api/web/GetFolderByServerRelativeUrl('/Shared Documents')" headerout=headers out=resp2 AUTH_NEGOTIATE HEADEROUT_OVERWRITE; run; %echofile(headers);
But the resp2-File gives no meaningful answer. Even though the status is 200.
HTTP/1.1 200 OK Server: Microsoft-IIS/7.5 Date: Thu, 08 Jun 2017 13:51:40 GMT Connection: close
So I definitely have no clue, what happens in this proc http and from where it got the result...
I am still not clear why you are using 2 form of authentication.
You are sending in a Bearer token (I am guessing this is Microsoft Claims based auth)
and are also using NTLM or Kerberos.
If your access token is still valid, try just using the token and add AUTH_NONE to your proc statement.
Thank you Joseph.
This is something I don't understand either. The REST-API documentation written by Microsoft told me to send that ' Authorization: "Bearer " + accessToken' header.
So you want me to try this?:
/* prepare the input header: */ data _null_; file input recfm=f lrecl=1; put "Authorization: Bearer &token."; put '0d'x'0a'x; put "X-RequestDigest: form digest value"; run; proc http method='POST' in=input url="http://&base_url./sites/_api/web/GetFileByServerRelativeUrl('/ASK-TP-DS/Dokumente/Forms/test_jat.txt')/CheckOut()" headerout=headers out=resp2 AUTH_NONE HEADEROUT_OVERWRITE; run; %echofile(headers);
This results in an empty resp2 and a headers that says:
HTTP/1.1 401 Unauthorized Server: Microsoft-IIS/7.5 SPRequestGuid: 5f57611d-0ef9-4a30-a263-d5db0ca8bdf3 WWW-Authenticate: Negotiate WWW-Authenticate: NTLM X-Powered-By: ASP.NET MicrosoftSharePointTeamServices: 14.0.0.7175 X-MS-InvokeApp: 1; RequireReadOnly Date: Thu, 08 Jun 2017 14:05:35 GMT Content-Length: 0
I am trying to connect using Active Directory from Linux SAS to my on Premise SharePoint using CURL. I am able to do the command from my desktop, but am getting 401 authentication errors when trying to authenticate from ssh command line. Would it be easier to me to request a local id, instead of trying to connect with AD?
Command:
curl -v --NTLM --user $USER -L "URL" --output file.xlsx
Error:
< HTTP/1.1 401 Unauthorized
< Server: Microsoft-IIS/8.5
< SPRequestGuid: 6fb9fc9f-e632-1097-77e6-b91901d368ed
< request-id: 6fb9fc9f-e632-1097-77e6-b91901d368ed
< X-FRAME-OPTIONS: SAMEORIGIN
< SPRequestDuration: 71
< SPIisLatency: 0
< WWW-Authenticate: Negotiate
* NTLM handshake rejected
* Authentication problem. Ignoring this.
< WWW-Authenticate: NTLM
< X-Powered-By: ASP.NET
< MicrosoftSharePointTeamServices: 16.0.0.4705
< X-Content-Type-Options: nosniff
< X-MS-InvokeApp: 1; RequireReadOnly
< Date: Mon, 25 Oct 2021 21:45:11 GMT
< Content-Length: 0
<
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
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.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.