关注 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/