locked
403 forbidden and Token request failed issue in sharepoint csom RRS feed

  • Question

  • we are performing CRUD operations on sharepoint list by using appid appsecret for authentication. We have also used multithreading here so for each thread new clientcontext is generated

    string siteUrl = "https://tenant.sharepoint.com/sites/demo";  

    Parallel.Foreach(users in (tempuser)=> {

    using (var cc = new AuthenticationManager().GetAppOnlyAuthenticatedContext(siteUrl, "[Your Client ID]", "[Your Client Secret]"))  
    {  
        cc.Load(cc.Web, p => p.Title);  
        cc.ExecuteQuery();  
        Console.WriteLine(cc.Web.Title);  
    };  });

    we are trying to perform CRUD operations for 1.5 lacs records. After executing executequery certain number of times it is showing 403 forbidden error. So we used throttling ExecuteQueryWithIncrementalRetry() mention in below article. It still showing 403 forbidden error. Can anyone help me for this issue. When i try to debug it works perfectly but after executing certain number of time its showing 403 forbidden and Token request failed issue

    https://docs.microsoft.com/en-us/sharepoint/dev/general-development/how-to-avoid-getting-throttled-or-blocked-in-sharepoint-online






    Sunday, May 24, 2020 2:26 AM

All replies

  • Maybe a SharePoint forum would be more appropriate? 

    https://social.msdn.microsoft.com/forums/sharepoint/en-us/home?category=sharepoint

    Sunday, May 24, 2020 7:20 AM