After I deploy Sitecore.Commerce.Engine.SDK.7.0.55
, I use postman
and call to API /GenericSearch()
follow this doc:
I can not get a result similar to this document and get the below error.
00232 14:54:41 ERROR SitecoreConnectionManager: RETRY 1 out of 3 with ERROR Forbidden from GET /sitecore/api/ssc/item/?path=%2Fsitecore%2FCommerce%2FCommerce%20Control%20Panel%2FStorefront%20Settings%2FStorefronts%2FStorefront&database=master&language=en
00290 15:29:45 ERROR CommerceController.OnActionExecuting.Forbidden: User not allowed for action /api/GenericSearch()
00069 15:29:52 ERROR Connection ID ""18086456105130525033"", Request ID ""8000016e-0000-fb00-b63f-84710c7967bb"": An unhandled exception was thrown by the application.
Microsoft.AspNetCore.Antiforgery.AntiforgeryValidationException: The required antiforgery cookie ".AspNetCore.Antiforgery.TinCpCZNkek" is not present.
at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery.ValidateRequestAsync(HttpContext httpContext)
at Sitecore.Commerce.Core.CommerceODataController.ValidateAntiForgery(ActionExecutingContext context)
at Sitecore.Commerce.Core.CommerceODataController.OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Sitecore.Commerce.Core.ValidateCommerceConnectTokenMiddleware.Invoke(HttpContext context)
at Sitecore.Commerce.Core.RoleAuthorizationMiddleware.Invoke(HttpContext context)
at Sitecore.Commerce.Core.ValidateRolesHeaderMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Sitecore.Framework.Diagnostics.DiagnosticMetadataMiddleware.Invoke(HttpContext context)
at Sitecore.Framework.Diagnostics.DiagnosticPageMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContextOfT`1.ProcessRequestAsync()
When I check logs, I see that the API is blocked and the user is not allowed. How can I resolve it?