0

We are facing an issue in accessing Magento APIs that has self authorization level set in webapi.xml even when supplied appropriate JWT token as bearer.

The APIs give the following error in all the cases. Response error: { "message": "The consumer isn't authorized to access %resources.", "parameters": { "resources": "self" } }

We are facing this issue after migrating from 2.3.3 to 2.4.5.

By looking at mageto & other blogs we have taken care of setting Oauth -> Allow OAuth access tokens to be used as standalone bearer tokens to TRUE. However, this did not make any impact

Please find the detailed error from logs below.

report.WARNING: Rest Localaized exception: The consumer isn't authorized to access self. {"request_method":"GET","request_uri":"/rest/all/V1/customer/profile","request_params":[],"request_content":"","stack_trace":"#0 /var/www/vendor/magento/module-webapi/Controller/Rest/RequestValidator.php(68): Magento\Webapi\Controller\Rest\RequestValidator->checkPermissions() #1 /var/www/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Webapi\Controller\Rest\RequestValidator->validate() #2 /var/www/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Webapi\Controller\Rest\RequestValidator\Interceptor->___callParent('validate', Array) #3 /var/www/vendor/paypal/module-braintree-core/Plugin/RestValidationPlugin.php(86): Magento\Webapi\Controller\Rest\RequestValidator\Interceptor->Magento\Framework\Interception\{closure}() #4 /var/www/vendor/magento/framework/Interception/Interceptor.php(135): PayPal\Braintree\Plugin\RestValidationPlugin->aroundValidate(Object(Magento\Webapi\Controller\Rest\RequestValidator\Interceptor), Object(Closure))

Appreciate any quick help in resolving this issue.

0 Answers0