本文介绍了如何从 Magento REST API 令牌中获取用户 ID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
限时送ChatGPT账号..按照这些说明,很容易看到Magento 在授予 OAuth 令牌后将其与用户 ID 相关联.给定 OAuth 令牌,有没有办法以编程方式恢复用户 ID?
Following these instructions, it's easy to see that Magento is associating the OAuth tokens with a user id after they're granted. Is there a way to programmatically recover the user id, given the OAuth token?
推荐答案
如果有帮助,你可以这样做:
If helps, you can do it like this:
// 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();
}
这篇关于如何从 Magento REST API 令牌中获取用户 ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论