1

I have a Sitecore 10.3 XP installation and a Visual Studio solution with Helix, where we are implementing components. My local Sitecore CM installation is running perfectly fine. However, when I am trying to run my VS solution, I am getting the error An invalid request was sent to the Sitecore layout service. We are using JSS headless implementation and even though everything is correctly installed and verified, I have an access denied message from the JSS API key:

https://unify-103-xp-sc.dev.local/sitecore/api/layout/render/jss?item=/&sc_apikey={key}&sc_site={website-name}

Any suggestion/direction will be highly appreciated.

I tested the GraphQL API and it is working fine. I have re-installed the JSS headless implementation and by looking at the folder structure it looked okay I verified that in the web database, the key is the same as in the master. I verified the publishing is done Somehow I am getting access denied for the JSS headless API key.

2
  • Where is it hosted? IIS or docker? Is the 403 coming from Sitecore. Possible to show a screenshot? Commented Sep 22, 2023 at 18:26
  • It is hosted on IIS. 403 is coming from Sitecore.
    – Sankar
    Commented Sep 25, 2023 at 4:56

1 Answer 1

1

Can you check the following :

  1. Check if you have a Firewall or VPN which is denying access.

  2. Note that Sitecore instance host and LayoutServiceHost can be different.

    E.g. in example below the Sitecore instance name in my local is "https://searchdemosc.dev.local" and Sitecore API or Layout Service Host is "https://jsshomepage"

  3. Check the api key, deployment secret are correctly matching in scjssconfig.jss and .env files as shown below :

enter image description here

enter image description here

  1. Check if https is used e.g. SITECORE_API_HOST=https://jsshomepage in .env file, then you have https binding in IIS. If not Try changing the host to http.

  2. Make sure your Sitecore License has JSS license included

enter image description here

2
  • I am missing this.
    – Sankar
    Commented Sep 25, 2023 at 7:30
  • I was using incorrect license file, so JSS license was missing. I have replaced it with correct one, now it works! Thank you!!!!
    – Sankar
    Commented Sep 25, 2023 at 7:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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