0

Very similar to this question: xConnect The HTTP response was not successful: Unauthorized

But in this case, it's in Azure PaaS so a lot of the answers are not applicable.

How can I make sure the app user has access to the certificate? I do have it under SSL Setting in azure CD webapp, and the thumbprint matches the one in xConnect config.

Stack Trace:

[XdbCollectionUnavailableException: The HTTP response was not successful: Unauthorized]
   Sitecore.Xdb.Common.Web.Synchronous.SynchronousExtensions.SuspendContextLock(Func`1 taskFactory) +518
   Sitecore.XConnect.Client.XConnectSynchronousExtensions.SuspendContextLock(Func`1 taskFactory) +20
   Sitecore.XConnect.Client.Configuration.SitecoreXConnectClientConfiguration.Initialize(XmlNode configNode) +93
   Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +253
   Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert) +72
   Sitecore.Configuration.DefaultFactory.CreateObject(String configPath, String[] parameters, Boolean assert) +697
   Sitecore.XConnect.Client.Configuration.SitecoreXConnectClientConfiguration.GetClient(String clientConfigPath) +16
   Sitecore.Analytics.XConnect.DataAccess.XConnectDataAdapterProvider.ExecuteWithExceptionHandling(Func`2 func) +44

[XdbUnavailableException: xDB unavailable]
   Sitecore.Analytics.XConnect.DataAccess.XConnectDataAdapterProvider.ExecuteWithExceptionHandling(Func`2 func) +202
   Sitecore.Analytics.XConnect.DataAccess.<>c__DisplayClass16_0.<LoadContact>b__0() +25
   Sitecore.Analytics.XConnect.Diagnostics.PerformanceCounters.OperationPerformanceMonitorExtensions.Monitor(OperationPerformanceMonitorBase monitor, Func`1 operation) +57
   Sitecore.Analytics.Data.ContactRepository.LoadContact(String source, String identifier) +84
   Sitecore.Analytics.Tracking.ContactManager.LoadContact(String source, String identifier) +185
   Sitecore.Analytics.Tracking.StandardSession.GetContactByIdentifier(String source, String identifier, ContactManager contactManager, Action`1 validateIdentifier) +383
   Sitecore.Analytics.Tracking.StandardSession.GetContactByIdentifier(String source, String identifier, ContactManager contactManager) +164
   Sitecore.Analytics.Tracking.StandardSession.IdentifyAs(String source, String knownIdentifier) +269
   Carlsberg.Foundation.Accounts.Services.ContactProfileService.SetProfile(String email, String oldEmail) +177
   Carlsberg.Foundation.Accounts.Services.AccountTrackerService.TrackLogin(String email, String oldEmail) +84
   Carlsberg.Feature.Accounts.Repositories.AccountRepository.Login(String userName, String password, String oldEmail, Boolean emailChange) +1023
   Carlsberg.Feature.Accounts.Controllers.AccountsController.Login(LoginInfo loginInfo, Func`2 redirectAction) +125
   lambda_method(Closure , ControllerBase , Object[] ) +139
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +229
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +35
   System.Web.Mvc.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() +80
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +454
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +454
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +454
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +973
   System.Web.Mvc.Controller.ExecuteCore() +128
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +235
   Sitecore.Mvc.Controllers.ControllerRunner.ExecuteController(Controller controller) +312
   Sitecore.Mvc.Controllers.ControllerRunner.Execute(TextWriter writer) +181
   Sitecore.Mvc.Pipelines.Response.RenderRendering.ExecuteRenderer.Render(Renderer renderer, TextWriter writer, RenderRenderingArgs args) +147
   Sitecore.Mvc.Pipelines.Response.RenderRendering.ExecuteRenderer.Process(RenderRenderingArgs args) +74
   (Object , Object ) +14
   Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +484
   Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists) +236
   Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22
   Sitecore.Mvc.Pipelines.PipelineService.RunPipeline(String pipelineName, TArgs args) +195
   Sitecore.Mvc.Pipelines.Response.RenderPlaceholder.PerformRendering.Render(String placeholderName, TextWriter writer, RenderPlaceholderArgs args) +183
   (Object , Object ) +14
   Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +484
   Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists) +236
   Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22
   Sitecore.Mvc.Pipelines.PipelineService.RunPipeline(String pipelineName, TArgs args) +195
   Sitecore.Mvc.Helpers.SitecoreHelper.RenderPlaceholderCore(String placeholderName, TextWriter writer) +250
   Sitecore.Mvc.Helpers.SitecoreHelper.Placeholder(String placeholderName) +61
   ASP._Page_Views_Storefront_Global_Masterlayout_cshtml.Execute() in d:\home\site\wwwroot\Views\Storefront\Global\Masterlayout.cshtml:167
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +148
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +122
   System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) +136
   Sitecore.Mvc.Presentation.ViewRenderer.Render(TextWriter writer) +257

[InvalidOperationException: Error while rendering view: '/Views/Storefront/Global/Masterlayout.cshtml' (model: 'Sitecore.Mvc.Presentation.RenderingModel, Sitecore.Mvc').
]
   Sitecore.Mvc.Presentation.ViewRenderer.Render(TextWriter writer) +729
   Sitecore.Mvc.Pipelines.Response.RenderRendering.ExecuteRenderer.Render(Renderer renderer, TextWriter writer, RenderRenderingArgs args) +147
   Sitecore.Mvc.Pipelines.Response.RenderRendering.ExecuteRenderer.Process(RenderRenderingArgs args) +74
   (Object , Object ) +14
   Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +484
   Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists) +236
   Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22
   Sitecore.Mvc.Pipelines.PipelineService.RunPipeline(String pipelineName, TArgs args) +195
   Sitecore.Mvc.Presentation.RenderingView.Render(ViewContext viewContext, TextWriter writer) +331
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +375
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +88
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +775
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +775
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +81
   System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +188
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +38
   System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +29
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +73
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +52
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +39
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38
   System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +43
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +73
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38
   Sitecore.Mvc.Routing.RouteHttpHandler.EndProcessRequest(IAsyncResult result) +78
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +648
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +213
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +131
  • Is it a self-signed certificate? – Gatogordo Feb 25 at 10:53
  • Yes, it is a self-signed certificate. – Batista Feb 25 at 11:54
  • Did you use Sitecore commerce ARM templates? Because that would take care of all that for you. Considering the Certificate blob you passed in ARMs parameters is valid and not expired. – Yassine Alahyane Feb 25 at 15:39
  • Yes, we used ARM templates. It should take care of it, but something is not working well. – Batista Feb 26 at 9:32
  • Update the question with the stack trace please – Mark Gibbons Feb 26 at 9:44
2

Figured it out. This annoying setting was missing "Incoming Client Certificates". Incoming Client Certificates

0

In all your instances that connect to xConnect:

  • Ensure in your web config you have the following setting <add key="AllowInvalidClientCertificates" value="true"/>

  • Make sure that in the App settings you have for WEBSITE_LOAD_CERTIFICATES is set to the thumbprint of the client certificate as shown in this screenshot

enter image description here

  • Thanks, but that's already in place. – Batista Feb 26 at 9:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.