【发布时间】:2013-09-08 05:03:31
【问题描述】:
在these instructions 之后,很容易看到 Magento 在授予 OAuth 令牌后将其与用户 ID 相关联。给定 OAuth 令牌,有没有办法以编程方式恢复用户 ID?
【问题讨论】:
标签: api magento rest oauth token
在these instructions 之后,很容易看到 Magento 在授予 OAuth 令牌后将其与用户 ID 相关联。给定 OAuth 令牌,有没有办法以编程方式恢复用户 ID?
【问题讨论】:
标签: api magento rest oauth token
如果有帮助,您可以这样做:
// 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();
}
【讨论】: