api - 如何从 Magento REST API token 中获取用户 ID?

标签 api magento rest oauth token

关注 these instructions ,很容易看出 Magento 在授予 OAuth token 后将其与用户 ID 相关联。给定 OAuth token ,有没有办法以编程方式恢复用户 ID?

最佳答案

如果有帮助,你可以这样做:

// Should be a collection of one element (or zero if nothing found)
$tokens = Mage::getModel('oauth/token')->getCollection()->addFilterById($tokenId);
foreach ($tokens as $token) {
    echo $token->getCustomerId();
}

关于api - 如何从 Magento REST API token 中获取用户 ID?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18618079/

相关文章:

excel - 如何使用flutter导出excel表格中的json数据

IOS Iphone 3G 的 Javascript API 用于相机访问

python - 如何用文件修补资源

php - 使用 setData 将数据从布局传递到 block Controller

Angular 6 HttpErrorResponse 在 POST 上的状态为 200

php - 捆绑产品的 Magento Checkbox 需要数量

php - 更改 magento 中我的帐户页面的导航顺序

python - 使用 flask 对请求中的嵌套对象进行单元测试

java - java中的cURL命令

java - Springboot 中的 @Value 返回 null