1

I have set up a SharePoint Designer 2013 site workflow with an app step to perform a REST call that reads a list on the site and sends email notifications if anything has been updated. The site workflow runs and then pauses for 7 minutes and then runs again.

Unfortunately, it seems every fourth or fifth call the REST call returns a responseCode of Unauthorized and if I look at the response headers I see something like this.

{  
   "x-ms-diagnostics":[  
      "3001000;reason=\"There has been an error authenticating the request.\";category=\"invalid_client\""
   ],
   "SPRequestGuid":[  
      "09dcc251-f454-aa4f-b5ff-2f306320e5d6"
   ],
   "request-id":[  
      "09dcc251-f454-aa4f-b5ff-2f306320e5d6"
   ],
   "X-FRAME-OPTIONS":[  
      "SAMEORIGIN"
   ],
   "SPRequestDuration":[  
      "12"
   ],
   "SPIisLatency":[  
      "0"
   ],
   "Server":[  
      "Microsoft-IIS\/7.5"
   ],
   "WWW-Authenticate":[  
      "Bearer realm=\"ea9d8fda-946e-4bb7-8192-a9c1a52bd451\",client_id=\"00000003-0000-0ff1-ce00-000000000000\",trusted_issuers=\"00000005-0000-0000-c000-000000000000@*,00000003-0000-0ff1-ce00-000000000000@ea9d8fda-946e-4bb7-8192-a9c1a52bd451\"",
      "Negotiate",
      "NTLM"
   ],
   "X-Powered-By":[  
      "ASP.NET"
   ],
   "MicrosoftSharePointTeamServices":[  
      "15.0.0.4512"
   ],
   "X-Content-Type-Options":[  
      "nosniff"
   ],
   "X-MS-InvokeApp":[  
      "1; RequireReadOnly"
   ],
   "Date":[  
      "Mon, 31 Jul 2017 22:14:02 GMT"
   ]
}

I have enable Workflows can use app permissions and checked that the REST call is in an App Step in the workflow. And it does work most of the time.

I have the errors send me an email with the rest url/endpoint and when I check those using javascript calls or my RESTlet Chrome extension the endpoint is fine.

Anybody else have intermittent authorization failures? Any ideas where to look? I only have Site Collection admin permissions. But I can work with the central admin if I can tell them where to look.

Additional info

I tried fixing it by adding a POST to get the form digest authorization

<site>/_api/contextinfo

This is also returning unauthorized intermittently. Sometimes it works, sometimes it doesn't.

Yet more info

I tried resuming the suspended workflow and it gave me the following message.

Retrying last request. Next attempt scheduled in less than one minute. Details of last request: HTTP Unauthorized to https://site/_vti_bin/client.svc/sp.utilities.utility.ResolvePrincipalInCurrentcontext(input=@ParamUser,scopes='15',sources='15',inputIsEmailOnly='false',addToUserInfoList='False')?@ParamUser='i:0#.w|domain\my-id'

So this tells me that the issue is with the authentication of the app step.

  • You haven't give app permissions to workflow. You can follow this link to give permissions to workflow app. Hope, this will work for you. – gachCoder Aug 1 '17 at 6:59
  • 1
    Whenever I see 'intermittent' errors like this I think load balancing. Do you have a complex SharePoint structure using load balancing, and is there a server out there that is having user permission issues? We don't do load balancing, so this is just a guess. – Robin in Or Aug 2 '17 at 15:13
  • I got a message back from our IT team "We did notice security token service issue which was failing to create the cache keys on a web front end server and we cleared it..." 24 hours in and no more unauthorized errors. – Rothrock Aug 4 '17 at 15:42

Your Answer

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

Browse other questions tagged or ask your own question.