Trying to setup local spartacus with 2011 Commerce Cloud
and spartacussampledata
. Few restful endpoints are throwing 401 unauthorized access. Followed this link for setup: https://sap.github.io/spartacus-docs/building-the-spartacus-storefront-from-libraries

- 81
- 7
-
1Did you check backgroud console log? – mkysoft Apr 14 '21 at 08:20
-
1`INFO [hybrisHTTP5] [RestHandlerExceptionResolver] Translating exception [org.springframework.security.access.AccessDeniedException]: It's not allowed to execute this call from the current channel` – Irus Apr 14 '21 at 19:48
-
1@mkysoft here you go the backend error – Irus Apr 14 '21 at 20:38
-
I'm having the same issue. Have you found any soulution? – fredyjimenezrendon Jun 10 '21 at 03:21
-
Heey @Irus! Could you solve this? I'm having this problem. – Nicolas Villacorta Feb 09 '22 at 15:35
2 Answers
To shed some light on the issue.
If you are receiving a response from the backend that says It's not allowed to execute this call from the current channel
, then you have misconfigured your storefront.
Basically, the endpoint is most likely hitting an endpoint used for B2B or B2C depending on which 'channel' you are currently in.
For example, in the screenshot, you are currently in B2C, but you are most likely calling the B2B channel. You should be calling the endpoint with users/${userId}/carts/${cartId}/entries?quantity=${quantity}
, but instead, you are calling an endpoint with orgUsers/${userId}/carts/${cartId}/entries?quantity=${quantity}
.
Notice users vs orgUsers as the difference.

- 166
- 3
I would like to contribute!
Here in my project I am instantiating a Spartacua TUA (Telco Utilities Accelerator)
I've been having this problem "It's not allowed to execute this call from the current channel" and in my case the solution was to review the property "api.compatibility.b2c.channels" which was with the B2B value for the B2C store. I changed the value and it worked correctly again!