Virto Commerce: frontend not working - virtocommerce

I have a fully functional 'platform' (test) solution, both locally and on azure, but I have troubles to setup a working 'storefront' solution, first locally! I followed all the steps within documentation, but I have no "\App_Data\cms-content\" path mentioned within ContentConnectionString storefront setting in Web.config. My storefront website correctly connects to the default store but some exceptions throw during debug; I have some category and product in default store catalog, but nothing of these appear (see attached images): where I wrong?
Exception
Homepage with errors and no products

Look to the platform 'App_data' directory. Point is that storefront and platform should share the same CMS content location. So just use default path of the platform. Set ContentConnectionString to full path of platform "\App_Data\cms-content\" in storefront. For example:
<add name="ContentConnectionString" connectionString="provider=LocalStorage;rootPath=C:\vc-platform-master\VirtoCommerce.Platform.Web\App_Data\cms-content" />

Related

Why does my local checkout fails on Spartacus 1.5?

The Error
*polyfills.js:3050 GET https://localhost:9002/rest/v2/powertools/cms/pages?fields=DEFAULT&pageType=ContentPage&pageLabelOrId=/checkout&lang=en&curr=USD 404*
I am not able to perform checkout on both of my local powertools and electronics sites. The Chrome console log complains about the error shown above. Also, I have tried opening the given link in a new tab and it says No content page found matching the provided label or id: /checkout. Checked the WCMS Pages in my local Backoffice, I couldn't find any page with label or id as "checkout".
Could it be that I have to setup my local with the b2c_for_spartacus? (I have setup mine with b2c_b2b_acc_oms recipe instead)
Have you installed your SAP Commerce instance with the Spartacus Sample Data AddOn? The standard Powertools data setup will not include this, but the additions in spartacussampleadataaddon do. Please see links/instructions in https://sap.github.io/cloud-commerce-spartacus-storefront-docs/installing-sap-commerce-cloud/
If installed/setup correctly you should have a content page with UID=Checkout in the powertools-spaContentCatalog content catalog

Missing configuration for the issuer of security tokens error

I inherited an existing project without its development environment. I have UAT code and a backup of the Production database. I can run up the site locally via Visual Studio but have hit an authentication problem trying to setup a fresh standalone DEV server on AWS (single server, no load balancer). The doco indicates the Prod server is a dual server setup with a load balancer.
The front end site pages do display, although some search is not working. On trying to log into the backend pages, Chrome returns "The xxx page isn't working. xxx redirected you too many times." Using developer tools, I can see the page redirects back and forth between SWT?realm=... and sitefinity?wrap_defalted=true&wrap_access_token... On the second redirect response header there is "X-Authentication-Error:Missing configuration for the issuer of security tokens 'https://xxx/Sitefinity/Authenticate/SWT' "
I tried different values in the web.config lines:
<federatedAuthentication>
<wsFederation passiveRedirectEnabled="true" issuer="http://localhost" realm="http://localhost" requireHttps="true"/>
<cookieHandler requireSsl="false"/>
</federatedAuthentication>
but that actually made things worse so I have reverted.
I checked all the settings mentioned in http://docs.sitefinity.com/administration-switch-to-claims-based-authentication and they seem to be set correctly. I don't really know what else I can check to get this working.
I found http://docs.sitefinity.com/administration-configure-security, but it does not seem like these settings are set (I don't have access to Prod server so can't confirm if it is actually setup with load balancing). I am currently using a 30 day trial license so am not sure if this is contributing to the problem. The official license is in the process of being transferred by the client. The domain name associated with the official license would be different to the domain my new server is currently running on.
I am also running version 8 code on a version 9 install of Sitefinity. I wanted to get it working before I tried to upgrade the code. I think there was also an assembly load to manifest mismatch when I tried upgrading my local version.
Found the solution: Don't mess with the SecurityConfig.config file.
<securityTokenIssuers>
<add key="B886AA7BFB5515BA63F577A44BBEB5C7AE674035514D128BC397346B11F4C97A" encoding="Hexadecimal" membershipProvider="Default" realm="http://localhost" />
</securityTokenIssuers>
<relyingParties>
<add key="B886AA7BFB5515BA63F577A44BBEB5C7AE674035514D128BC397346B11F4C97A" encoding="Hexadecimal" realm="http://localhost" />
</relyingParties>
Even though it is running on a server, the above lines should still point to localhost. It seems like these only need to be edited if you have a multi-server setup with an entirely separate STS.
I initially changed it to match the new domain name, but after some experimentation around adding localhost and HTTP variations, it seems like it works best with just localhost.
Even when I changed the web.config entry above to use the new domain as the issuer instead of localhost and the SecureConfig.config to specify only the new domain as the realms, it didn't seem to work. I guess the authentication must try to hit localhost specifically.

Endeca-Hybris integration not working

i'am trying to integrate hybris 4.7.9 with endeca. I have installed the following endeca components. 1)MDEX engine 2)Platform services 3)Endeca workbench 4)CAS.
I have deployed a sample application on endeca side using "D:\Endeca\ToolsAndFrameworks\11.0.0\deployment_template\bin\deploy.bat"
In Hyend2 in admincockpit of hybris
I have made EAC/CAS connection with my appication and made a export job.
Problem is i am not able to run that job, it reports me following error:
http://localhost:8500/MyAppen_en_data/?wsdl returned response code 404
at com.endeca.itl.service.ServiceLocator.getService(ServiceLocator.java:150)
I don't know Hybris, but since the error is related to Endeca, let me try to give some pointers.
CAS: Check that CAS is up and running
App Name: You might have specified app-name-with-locale (MyAppen) somewhere where you need to specify only app-name (MyApp). [The Endeca app name without the locale is called as "Base Application Name". Go back and check all your configurations in Hybris and Endeca].
You may also refer to this blog (Although it is for ATG framework, it should give idea for Hybris as well).

Where can I find the contents of signalr/hubs

In a typical SignalR view it includes...
<script src="/signalr/hubs"></script>
I'm trying to get my head around SignalR and want to look at the javascript within this folder. But I cant find it within my project.
Also, I understand this contains javascript that is generated customised for my hub class etc. Is this correct?
The /signalr/hubs file is dynamically created by the SignalR server when the app boots up. Since the SignalR server hangs off of the /signalr endpoint it then generates the /hubs ontop of it.
Here's how SignalR 2.0.2 generates the file at a high level: https://github.com/SignalR/SignalR/blob/2.0.2/src/Microsoft.AspNet.SignalR.Core/Hubs/DefaultJavaScriptProxyGenerator.cs .
And here's where it determines that the request is to /signalr/hubs (in 2.0.2) https://github.com/SignalR/SignalR/blob/2.0.2/src/Microsoft.AspNet.SignalR.Core/Hubs/HubDispatcher.cs#L235-L253
Finally to answer your last question, it absolutely does. This is why it's dynamically generated. If you'd ever like to get a physical file that represents the /signalr/hubs endpoint you can follow the instructions here: http://www.asp.net/signalr/overview/signalr-20/hubs-api/hubs-api-guide-javascript-client#manualproxy
Hope this helps!
You are correct. It's dynamically generated so that's why you can't see it in visual studio. Enable directory browsing in your web.config by adding
<system.webServer>
<directoryBrowse enabled="true"/>
</system.webServer>
You can then navigate to localhost/signalr/hubs to see the file contents.

Web Deploy API (deploy .zip package) Clarification

I'm using the web deploy API to deploy a web package (.zip file, created by MSDeploy.exe) to programmatically roll the package out to a server (we need to do some other things before we release the package which is why we're not doing it all in one go using MSDeploy.exe).
Here's the code I have. My question is really to clarify what is happening when this is executed. In the package parameters XML file I have the application name specified ("Default Web Site") but that's about it, there's no other params are specified in there. From testing the server it appears the package gets deployed successfully but my question is are any other settings on the server I'm deploying to getting changed without my knowledge, are any default settings published etc.? Things like security settings, directory browsing etc. that I might not be aware of? The code here seems to deploy the package but I'm anxious about using this on a production environment when I'm so unsure of how this API works. The MS documentation is not helpful (more like non-existant, actually).
DeploymentChangeSummary changes;
string packageToDeploy = "C:/MyPackageLocation.zip";
string packageParametersFile = "C:/MyPackageLocation.SetParameters.xml";
DeploymentBaseOptions destinationOptions = new DeploymentBaseOptions()
{
UserName = "MyUsername",
Password = "MyPassword",
ComputerName = "localhost"
};
using (DeploymentObject deploymentObject = DeploymentManager.CreateObject(DeploymentWellKnownProvider.Package,
packageToDeploy))
{
deploymentObject.SyncParameters.Load(packageParametersFile);
DeploymentSyncOptions syncOptions = new DeploymentSyncOptions();
syncOptions.WhatIf = false;
//Deploy the package to the server.
changes = deploymentObject.SyncTo(destinationOptions, syncOptions);
}
If anyone could clarify that this snippet should deploy a package to a web site application on a server, without changing any existing server settings (unless specified in the SetParameters.xml file) that would be really helpful. Any good resources on using the API or an explanation of how web deployment works behind the scenes would also be much appreciated!
The setparameters file just controls the value for the parameters defined in the package. A package might be doing much more than that. Web deploy has a concept of providers and any given package can have one or more providers.
If you want to make sure that the package is not changing server side settings the best approach you can take is to use the API but make the packages be deployed via Web Management Service. This will give you two benefits:
You can control what providers you allow through.
You can add users and give restricted permissions to them to deploy to their site or their folder etc.
The alternate approach is to:
In the package manually look at the archive.xml and look for the providers in the package. As long as you dont see any of the following providers that can cause server settings change such as apphostconfig or webserver or regkey (this is not a comprehensive list) you should be good. Runcommand is a provider that allows you to execute batch scripts or commands. While it is a good provider for admins themselves you need to consider whether you want to allow packages with such providers to run.
You can do the above mentioned inspection in code by calling getchildren on the deployment object you create out of the package and inspect the providers and the provider paths.