none
when we get the data using CSOM Data is not showing for user RRS feed

  • Question

  • Hi 

    I have created a list and retrieving the data using client context object model it not able to load excutequeryasync in sharepoint 2013 

    If i am enable remote interface permission in web application level in central administration  it showing data for only for valid users and it is not showing data for anonymous user.

    It is showing error as FAILED TO LOAD DATA FROM SERVER

    Tuesday, February 21, 2017 4:48 PM

All replies

  • Hi Rakesh,

    Have you pass credential in the Client Object Model code ?

    Please try to pass credential like below:

    NetworkCredential credentials = new NetworkCredential(“username”, “pwd”, “domain”);
    
    ClientContext context = new ClientContext(“http://thesitecollection”);
    
    context.Credentials = credentials;

    More information:

    Authentication when using the SharePoint client object model

    Thanks

    Best Regards


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Wednesday, February 22, 2017 6:45 AM
  • Thank you

    But i want data to be seen to all the user here i am not validating their username and password can you tell me how to show data for all user without validation

    All the Data which i am getting through rest api is visible to all user but while client context model only data is not visible 

    Wednesday, February 22, 2017 6:51 AM
  • Hi Rakesh,

    No, you don't need to validate each user credential in the code, but create a common develop account and then assign permission to the account, used the account in the code, so that the CSOM can access the data with the specific account which has valid permission.

    Thanks

    Best Regards


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Wednesday, February 22, 2017 7:38 AM