Sunday, May 15, 2016

401 unauthorized error in workflow when calling SharePoint 2013 based WCF web service.

SharePoint 2013 no longer allows SharePoint developers to create custom coded workflows in Visual Studio. Instead we must now create web services that we call from a workflow with the http workflow action.

when we tried to consume the web service in a workflow I got a 401 Unauthorized error.

I was rather reluctant to enable anonymous but unfortunate it turned out to be necessary to allow Workflow Manager to makes calls to my custom web service.

Before you go...

Enabling Anonymous is the first but there are two spots to control anonymous access in a web application, and you might want to consider the second one also.

For both steps: open Central administration and navigate to: Application management > Manage web applications.

To Enable Anonymous access: Click/highlight a web application row > Authentication Providers > Click 'Default'. Tick Enable anonymous access.

Your web service will now work but...

Set Policy: Click/highlight a web application row > Anonymous Policy. I discovered that if you select "Deny All - Has no access" the web service calls will still work! 

Theoretically this means anonymous access is now off again but I can still make web service calls. I do not claim to know exactly what is going on here but this seems to fit my need perfectly

No comments:

Post a Comment

What is the cost of migration to SharePoint 2016?

Below are the points to understand better how much the cost of migration to SharePoint 2016 could be for your organization: What ver...