I'm using Sitecore 9.2 scaled environment
on Azure
, and am trying to make .Net core 2.2
projects published on azure app service, not on the same instance of Sitecore azure connects to XConnect
,
I was facing some problems on finding the certificate so I posted this question and I had some help and found the solution by connecting through the below code:
public class CustomHandler : IHttpClientHandlerModifier {
public void Process(HttpClientHandler handler) {
X509Certificate cert = LoadYourCertificateHere();
handler.ClientCertificateOptions = ClientCertificateOption.Manual;
handler.ClientCertificates.Add(cert);
}
}
then used this:
var certificateModifier = new CertificateValidationHttpClientHandlerModifier();
certificateModifier.Process(handler);
Now I'm facing a new error The HTTP response was not successful: Forbidden
. I think this is because the certificate is not trusted by azure or something. So, Is there a way to move the certificate to local machine/root or currentUser/root? or Can someone please advise what to do?
please note: that everything is working fine locally with .Net core
but when I published the code this was the error