magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.52k stars 9.31k forks source link

The consumer isn't authorized to access %resources. Magento 2.4.7 on staging environment with auth1.0 #39289

Open mohitgohel80 opened 2 hours ago

mohitgohel80 commented 2 hours ago

Preconditions and environment

Steps to reproduce

URL: https://dev2.example.com/rest/V1/products/apitest This in headers: Authorization: "Bearer "

Expected result

Using the Token we are trying to update or delete the product, But we are getting consumer isn't authorized message.

We tried multiple ways but could not succeed.

Actual result

{"message":"The consumer isn't authorized to access %resources.","parameters":{"resources":"Magento_Catalog::products"},"trace":"#0 public_html/vendor/magento/module-webapi/Controller/Rest/RequestValidator.php(92): Magento\Webapi\Controller\Rest\RequestValidator->checkPermissions(Object(Magento\Webapi\Controller\Rest\Router\Route\Interceptor))\n#1 public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Webapi\Controller\Rest\RequestValidator->validate()\n#2 public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Webapi\Controller\Rest\RequestValidator\Interceptor->_callParent('validate', Array)\n#3 public_html/vendor/magento/module-re-captcha-webapi-rest/Plugin/RestValidationPlugin.php(83): Magento\Webapi\Controller\Rest\RequestValidator\Interceptor->Magento\Framework\Interception{closure}()\n#4 public_html/vendor/magento/framework/Interception/Interceptor.php(135): Magento\ReCaptchaWebapiRest\Plugin\RestValidationPlugin->aroundValidate(Object(Magento\Webapi\Controller\Rest\RequestValidator\Interceptor), Object(Closure))\n#5 public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Webapi\Controller\Rest\RequestValidator\Interceptor->Magento\Framework\Interception{closure}()\n#6 publichtml/generated/code/Magento/Webapi/Controller/Rest/RequestValidator/Interceptor.php(23): Magento\Webapi\Controller\Rest\RequestValidator\Interceptor->callPlugins('validate', Array, NULL)\n#7 public_html/vendor/magento/module-webapi/Controller/Rest/InputParamsResolver.php(108): Magento\Webapi\Controller\Rest\RequestValidator\Interceptor->validate()\n#8 public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Webapi\Controller\Rest\InputParamsResolver->resolve()\n#9 public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Webapi\Controller\Rest\InputParamsResolver\Interceptor->_callParent('resolve', Array)\n#10 public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Webapi\Controller\Rest\InputParamsResolver\Interceptor->Magento\Framework\Interception{closure}()\n#11 publichtml/generated/code/Magento/Webapi/Controller/Rest/InputParamsResolver/Interceptor.php(23): Magento\Webapi\Controller\Rest\InputParamsResolver\Interceptor->callPlugins('resolve', Array, Array)\n#12 public_html/vendor/magento/module-webapi/Controller/Rest/SynchronousRequestProcessor.php(85): Magento\Webapi\Controller\Rest\InputParamsResolver\Interceptor->resolve()\n#13 public_html/vendor/magento/module-webapi/Controller/Rest.php(201): Magento\Webapi\Controller\Rest\SynchronousRequestProcessor->process(Object(Magento\Framework\Webapi\Rest\Request\Proxy))\n#14 public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))\n#15 public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Webapi\Controller\Rest\Interceptor->_callParent('dispatch', Array)\n#16 public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Webapi\Controller\Rest\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))\n#17 publichtml/generated/code/Magento/Webapi/Controller/Rest/Interceptor.php(23): Magento\Webapi\Controller\Rest\Interceptor->callPlugins('dispatch', Array, Array)\n#18 public_html/vendor/magento/framework/App/Http.php(116): Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))\n#19 public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\Http->launch()\n#20 public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\Http\Interceptor->_callParent('launch', Array)\n#21 public_html/vendor/magento/module-application-performance-monitor/Plugin/ApplicationPerformanceMonitor.php(38): Magento\Framework\App\Http\Interceptor->Magento\Framework\Interception{closure}()\n#22 public_html/vendor/magento/framework/Interception/Interceptor.php(135): Magento\ApplicationPerformanceMonitor\Plugin\ApplicationPerformanceMonitor->aroundLaunch(Object(Magento\Framework\App\Http\Interceptor), Object(Closure))\n#23 public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\Http\Interceptor->Magento\Framework\Interception{closure}()\n#24 publichtml/generated/code/Magento/Framework/App/Http/Interceptor.php(23): Magento\Framework\App\Http\Interceptor->callPlugins('launch', Array, NULL)\n#25 public_html/vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http\Interceptor->launch()\n#26 public_html/pub/index.php(30): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))\n#27 {main}"}

Additional information

We have already setting this refer below snapshot for same!

image


image


Release note

No response

Triage and priority

m2-assistant[bot] commented 2 hours ago

Hi @mohitgohel80. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce.

m2-assistant[bot] commented 2 hours ago

Hi @engcom-Bravo. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down: