5

I started looking into sharepoint and from what I understood from my company architecture is

  1. It runs an on premise hosted server.

  2. SharePoint uses Active directories to authenticate the users.

How do I authenticate and get the results of a list view from an external system outside the network?

I tried using postman and basic auth with username and password to authenticate into SharePoint using this documentation

https://msdn.microsoft.com/en-us/library/office/jj164022.aspx

I tried http://sp-stg/_api/contextinfo and I get 401 unauthorized.

Can someone point me on what I am missing. Thanks in advance

3
  • AD is just a store. First you'll have to find what authentication is in use at target web application - basic, NTLM, forms. Do you have access to IIS or SP CA? Or maybe install Fiddler and see what responses you get from SP when opening the site in browser. Mar 15, 2016 at 17:53
  • @AzizKabyshev I am redirected to the share point authentication site mysite/_api/contextinfo when I open the SharePoint site in my browser and then I am authenticated through AD ( assuming I am authenticated before redirect to the sp-stg/_api/contextinfo)
    – Rao
    Mar 15, 2016 at 18:00
  • 1
    Your question is a bit confusing. Are you asking how to authenticate when using Postman or are you asking how to authenticate when building an application? If it's the latter, there can be several answers depending on what you are building. Is it a SharePoint App (Add-In), or a client application or external website? Are you using managed code (VB, C#) or JavaScript? Mar 18, 2016 at 13:50

1 Answer 1

1

By default basic auth is not enabled in SharePoint.

There are 3 other possibilities: NTLMV2, Kerberos and Federation.

If authentication is being Federated to AD via ADFS or similar, I will just say good luck, as it is a nightmare to configure/use correctly.

However if your environment just uses straight NTLM/Kerberos, you should be able to specify the network credentials on a HttpClient like so:

Client = new System.Net.Http.HttpClient(new HttpClientHandler()
{
new NetworkCredential(User, Password, Domain)
});

Further information about SharePoint REST auth can be found here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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