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
Basically, it is trying to connect to the SharePoint URL endpoint (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 published the URL in DNS). 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.
The key here is that make sure that both SharePoint and workflow host URLs are accessible from the SharePoint / Workflow Manager server.
My question is:
HOW should I make sure that both SharePoint and workflow host URLs are accessible from the SharePoint / Workflow Manager server?