4

We can authenticate SP Online sites via clientid/client secret and generate access token. How can we authenticate in on-prem environment?

We don't want to pass username/password to authenticate the SP site. Multiple articles are found for Online sites, but no pointers for SP OnPrem.

Please assist.

3
0

You can enable Basic Authentification in IIS Settings, then in postman, Authorization --> select Basic Auth type and set your account name and password.

http://ibtissamchabiba.blogspot.com/2017/03/solution-for-401-unauthorized-error.html

The above approach will not work until you are passing credentials or the authentication token in the request. We have another one, Request digest value is used only to prevent the cross-site scripting and not to authenticate the user.

To authenticate the current logged-in user then you have to send one more header to the request to pass the credentials as:

 xhrFields: { withCredentials: true }

And also you have to enable the URL Rewrite option in the IIS to prevent the preflight option from getting dropped. Please refer this LINK to get it done.

If the above approaches, doesn't help you, then kindly refer the below links,

  1. How to perform POST operations in SharePoint 2013 using REST API from external Application

  2. Authenticating to SharePoint from fiddler/postman fails with 401

1
0

Postman has NTLM in "beta" and it doesn't work. Insomina does NTLM without issues. I have used Insomnia to authenticate and make API Rest calls for SP2013 on prem without issue. You need to ensure that you are using the x-request-digest value for post calls.

https://insomnia.rest/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.