0

I have quite a common CSOM provider hosted app. (On Premise, HighTrust) Inside this app I use the infamous

using (var clientContext=GetContext()) {

   ...   
   clientContext.ExecuteQuery();
}

(I can provide more code if needed, but as this works in most browsers this should not be a code issue)

On the dev machine, everything works fine (any browser). At the customer, Chrome works and Firefox works. But the Internet Explorer (9 and 11) throw a 401 error:

System.Net.WebException: The remote server returned an error: (401) Unauthorized.\r\n at System.Net.HttpWebRequest.GetResponse() at Microsoft.SharePoint.Client.SPWebRequestExecutor.Execute() at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServer(ChunkStringBuildersb) at Microsoft.SharePoint.Client.ClientContextExtensions.ExecuteQueryImplementation(ClientRuntimeContext clientContext, Int32 retryCount, Int32 delay)

What could be the problem?

3
  • R u Creating the Context using Username and password or using SharePointContext and TokenHelper ..?
    – TARUN
    Commented May 12, 2017 at 12:48
  • Tokenhelper (SharePointContext.CreateAppOnlyClientContextForSPAppWeb)
    – Ole Albers
    Commented May 12, 2017 at 12:52
  • Allow the app to make app-only calls checked ?
    – TARUN
    Commented May 12, 2017 at 12:55

1 Answer 1

0

Allow the app to make app-only calls checked

Allow the App to make App-only calls

4
  • It is. Otherwise this would not work on chrome or firefox
    – Ole Albers
    Commented May 12, 2017 at 12:55
  • Make sure that lowercase Guid string like this.. make sure no Capital letter in the IssuerID <add key="IssuerId" value="983802ac-c7a9-4b50-8100-2c6e2773b9cf" />
    – TARUN
    Commented May 12, 2017 at 13:09
  • Try to create the Certificate again test it
    – TARUN
    Commented May 12, 2017 at 13:11
  • issuerID is already lowercase
    – Ole Albers
    Commented May 12, 2017 at 13:12

Your Answer

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

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