Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
按照这些说明,很容易看出 Magento 在授予 OAuth 令牌后将其与用户 ID 相关联。给定 OAuth 令牌,有没有办法以编程方式恢复用户 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(); }