Register-SPWorkflowService Failed to query the OAuth S2s metadata error

July 8, 2013

Scenario: You have followed all the specified TechNet requirements/permissions in setting up SharePoint 2013 and Workflow Manager 1.o farm but when Registering Workflow manager with SharePoint site collection you might have got the below error:

Register-SPWorkflowService : Failed to query the OAuth S2S metadata endpoint at URI ‘http://xxxx/_layouts/15/metadata/json/1’. Error details: ‘An error occurred while sending the request.’. HTTP headers received from the server – ActivityId: 5b035802-7a59-4235-acb5-943a0e21e942. NodeId:
xxxx. Scope: /SharePoint. Client ActivityId : 66bd6434-9778-4a6f-b275-63a399d73c8c.
At line:1 char:1 + Register-SPWorkflowService -SPSite “http://xxxx” -WorkflowHostUri
“http …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (Microsoft.Share…WorkflowService:
   RegisterSPWorkflowService) [Register-SPWorkflowService], InvalidRequestExc
    + FullyQualifiedErrorId : Microsoft.SharePoint.WorkflowServices.PowerShell



When looking at the SharePoint logs – the error details are

Microsoft.Workflow.Client.InvalidRequestException: Failed to query the OAuth S2S metadata endpoint at URI ‘http://xxxx/_layouts/15/metadata/json/1’. Error details: ‘An error occurred while sending the request.’. HTTP headers received from the server – ActivityId: 1b2624e2-42a0-4a93-8c93-2ada0630967c. NodeId: xxxx. Scope: /SharePoint. Client ActivityId : 487d86fd-c961-4d8c-aab2-47269989b292. —> System.Net.WebException: The remote server returned an error: (400) Bad Request.     at Microsoft.Workflow.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)     at Microsoft.Workflow.Client.HttpGetResponseAsyncResult`1.End(IAsyncResult result)     at Microsoft.Workflow.Client.ClientHelpers.SendRequest[T](HttpWebRequest request, T content)     — End of inner exception stack trace —     at Microsoft.Workflow.Client.ClientHelpers.SendRequest[T](HttpWebRequest request, T content)     at Microsoft.Workflow.Client.WorkflowManagementClient.SendRequest[T](HttpWebRequest request, T content)     at Microsoft.Workflow.Client.ScopeManager.PublishScopeInternal(ScopeDescription description, String[] pathSegments)     at Microsoft.SharePoint.WorkflowServices.WorkflowServerPairingContext.EnsureFarmScope(Boolean configureOAuth)     at Microsoft.SharePoint.WorkflowServices.PowerShell.RegisterSPWorkflowService.InternalProcessRecord()     at Microsoft.SharePoint.PowerShell.SPCmdlet.ProcessRecord()

Basically it is trying to connect to the SharePoint url end point (http://xxxx/_layouts/15/metadata/json/1 . In my case the SharePoint url (which has host header) was not accessible from Workflow Manager server (as I have not dns published the url). I added the SharePoint url to the Workflow manager server host file and can access the SharePoint url.

Now the Register-SPWorkflowservice command runs without issue.

Key here is that make sure that both SharePoint and workflowhost urls are accessible from the SharePoint / Workflow Manager server.

Hope this helps :-).

SharePoint 2013 – Workflow Manager 1.0 Install and configuration

April 12, 2013

In continuation to my last post, we have seen how to download Workflow Manager 1.0 components offline. Lets Install and configure with SharePoint Server 2013…

Step1: The Workflow Components are downloaded as below folder structure..


Step 2: Run the below command to invoke the Workflow Manager Configuration Manager screen..

WebpiCmd.exe /Install /Products:WorkflowManager

/XML:<directory of workflow manager downloads>


Eg: below..


Step 3: Workflow Manager Configuration Wizard screen starts..


Step 4: Click on Configure Workflow Manager with Default settings (Recommended). New Farm Configuration wizard opens and enter the required fields.  (Here I am talking about minimum required fields for configuration, there are advanced option parameters for setup a production farm)

SQL Server Instance: i.e The Database server for the Workflow Manager databases

Configure Service account: a dedicated domain service account for work flow manager

Certificate Generation Key: similar to Passphrase in SharePoint a password for securing the workflow manager farm. this is required when workflow manager farm extended..


Step 5: On clicking Right arrow bottom of the screen, configuration starts


Step 6: Upon successful installation all the check marks are passed with green


Step 7: Workflow manager is setups a IIS web site on the box hosting on port 12290 (for ssl) and 12291 for http (non ssl). you can add host url for the ports that are of interest in configuration such as workflowmanager (This way we can avoid using the server FQDN name while configure with SharePoint site collection)

you can verify the workflow manager Installation by accessing http://localhost:12291 or http://<host url>:12291 (if host url configured). XML file with configuration detail opens..

Step 8: Now run the below SharePoint PowerShell command to configure the workflow manager with a SharePoint 2013 site collection

Register-SPWorkflowService –SPSite “http://myserver/mysitecollection&#8221;

–WorkflowHostUri “;


Step 9: Verify the Workflow Manager configured successfully with the site collection by using SharePoint Designer 2013


SharePoint 2013 – Workflow Manager 1.0 offline download

March 13, 2013

Problem: There is no direct download to the Workflow manager and required components that need to Install and Configure Workflow Manager 1.o with SharePoint 2013.

If the server have internet connection “Web Platform Installer” does the job for you. This is good for quick setup of development environment but what if we want to setup on a server that don’t have internet connection. Also for consistent builds (Dev/QA/production) we need to download and install the same software across all the environments.

Solution: Below steps provide how to download the required Workflow Manager 1.0 components.

Here is the instructions from Microsoft link :

(Note: Please do not confuse with the below Microsoft link to download Workflow manager 1.0, again this is not full version).

Step 1: Logon to the machine where you have internet connection and down load the web platform installer “WebPlatformInstaller_amd64_en-US.msi” from here

Step 2: Extract the files from “WebPlatformInstaller_amd64_en-US.msi” to a folder. There are different ways to extract files from msi. below is the example using msiexec utilty.

Open Command prompt or powershell run as administrator and enter the below command:

msiexec /a <msi location with folder path> /qb TARETDIR = <folder location where the files needs to be extracted>


msiexec /a C:\SharePoint\SP2013\Tools\WebPlatformInstaller_amd64_en-US.msi /qb TARGETDIR=C:\

It will extract the folder structure as below.


Required “WebpiCmd.exe” available under <above target location>/Microsoft/Web Platform Installer

Step 3: Download Workflow Manager components using WebpiCmd.exe

In the command prompt or powershell

webpicmd.exe /offline /Products:WorkflowManager /Path:<folder directory to download>

wpi_ex2  wpi_ex4

screen shots of download…


How to install and configure Workflow Manager and SharePoint 2013… post…