我创建了一个新客户并获得了完美的令牌,但是当我尝试访问任何API时,例如
http://myhost.com/index.php/rest/V1/customers/me?Authorization=Bearerhy23vc01x9s1jd2t8gho47g58trllc0b
得到了错误
<?xml version="1.0"?>
<response>
<message>Consumer is not authorized to access %resources</message>
<parameters>
<resources>self</resources>
</parameters>
<trace>#0 /var/www/myhost.com/public_html/vendor/magento/module-webapi/Controller/Rest/RequestValidator.php(70): Magento\Webapi\Controller\Rest\RequestValidator->checkPermissions()
#1 /var/www/myhost.com/public_html/vendor/magento/module-webapi/Controller/Rest/InputParamsResolver.php(80): Magento\Webapi\Controller\Rest\RequestValidator->validate()
#2 /var/www/myhost.com/public_html/vendor/magento/module-webapi/Controller/Rest.php(299): Magento\Webapi\Controller\Rest\InputParamsResolver->resolve()
#3 /var/www/myhost.com/public_html/vendor/magento/module-webapi/Controller/Rest.php(216): Magento\Webapi\Controller\Rest->processApiRequest()
#4 /var/www/myhost.com/public_html/var/generation/Magento/Webapi/Controller/Rest/Interceptor.php(24): Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))
#5 /var/www/myhost.com/public_html/vendor/magento/framework/App/Http.php(135): Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#6 /var/www/myhost.com/public_html/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#7 /var/www/myhost.com/public_html/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#8 {main}</trace>
</response>
请任何帮助
products
您和一样完美地用于某些apicategories
,但是对于某些API(如)V1/customers/me
,我却收到了错误消息。即使我在终端机上卷曲,它也可以正常工作。我将邮递员和http请求者用于Firefox。