Hi,
I followed the article https://technet.microsoft.com/en-us/library/dn949332.aspx about 6 months ago to set up our DEV, UAT and PROD (to be) CRM environment integration that integrates with our Sharepoint Server. I went through all the issue to set the environment correctly such that DEV CRM integrations with DEV Sharepoint, UAT CRM connects to UAT Sharepoint and PROD CRM to PROD Sharepoint.
We were replacing Salesforce so we took a backup of CRM_UAT database and restored it as CRM_UAT_RT, We loaded all the Salesforce data into CRM_UAT_RT and when all the data is loaded we renamed CRM_UAT_RT to CRM_UAT. We did the Organisation import, as a result of this the CRM Realm id changed and I had to re-run below script with new realm Id in Sharepoint.
Get-SPTrustedSecurityTokenIssuer
Remove-SPTrustedSecurityTokenIssuer –Identity {name} where name is the prexisting STS in sharepoint
$i = New-SPTrustedSecurityTokenIssuer –Name "crmprod" –IsTrustBroker:$false –MetadataEndpoint "uat.xyz.com.au/.../json"
$site = Get-SPSite "my.xyz.com.au/.../crm"
$CrmRealmId = "150d2fd6-18f3-e611-80fe-000d3ad09ec5"
$Identifier = "00000007-0000-0000-c000-000000000000@" + $CrmRealmId
Register-SPAppPrincipal -site $site.Rootweb -NameIdentifier $Identifier -DisplayName "crmprod"
We followed this article http://www.techairgroup.com/solution-dynamics-crm-2016-sp1-on-premise-server-integration-to-sharepoint-2013-on-premise-issues/ and it worked in our UAT environment just fine.
Now, we took a backup of CRM_UAT and restored as CRM_PROD in PROD server and did the organisation import and when doing same steps we are getting below error:
<site>
<url>https://prod.xyz.com.au/sites/crm</url>
<exception>The request was aborted: The request was canceled.Sharepoint Realm ID did not match bearer challenge: [Scheme: Bearer, Parameters: [realm: 75f858cc-dd95-40f6-bb75-2616c429d2f6, client_id: 00000003-0000-0ff1-ce00-000000000000, trusted_issuers: 00000007-0000-0000-c000-000000000000@150d2fd6-18f3-e611-80fe-000d3ad09ec5,00000003-0000-0ff1-ce00-000000000000@75f858cc-dd95-40f6-bb75-2616c429d2f6]] with the service principal: [ServicePrincipalName: [PrincipalId: 00000003-0000-0ff1-ce00-000000000000, HostName: , Realm: 616ac38e-a6ec-45c5-a3c8-0d531966730b], TenantId: 00000000-0000-0000-0000-000000000000]</exception>
<errorcode>-2147088205</errorcode>
<correlation>dfb5e99d-ad83-602f-a91f-ef0f72314a34</correlation>
</site>
When going to CRM and trying to validate the site it says "Failed Authentication".
Can someone please help me point to right direction.
Thanks
Bikash