I tried to register Workflow Manager with my SharePoint site collection on a new SharePoint 2016 farm. I followed this article and everything was fine until the last step in the process, registering the Workflow Manager in SharePoint using this command:
Unfortunately I struck the following error:
Register-SPWorkflowService : Failed to query the OAuth S2S metadata endpoint at URI ‘http://sharepoint/_layouts/15/metadata/json/1;. Error details: ‘An error occurred while sending the request.’. HTTP headers received from the server….
Quite a few people reported this as being an issue with DNS registrations e.g. the SharePoint site URL not being accessible. I checked DNS name resolution and everything looked fine, so it must something else. If you are having name resolution issues try using a hosts file entry on the SharePoint server to resolve the issue.
The solution was to enable OAuth and Metadata over HTTP. To enable these settings use the following PowerShell on the SharePoint server:
$cfg = Get-SPSecurityTokenServiceConfig
$cfg.AllowOAuthOverHttp = $true
$cfg.AllowMetaDataOverHttp = $true
Now rerun the Register-SPWorkflowService PowerShell command to complete the registration.
I hope this saves you a bit of time!