简体   繁体   English

为什么在 shopify 中使用 api admin 搜索 ajax 会出现登录名和密码弹窗

[英]why does the login and password popup appear when you search for ajax using the api admin in shopify

I made an ajax search for blogs, and for action I use Admin API:我通过 ajax 搜索博客,并使用 Admin API 进行操作:

/admin/api/2022-07/blogs/{blog_id}/articles.json

I also, use action to get metafields:我也使用动作来获取元字段:

/admin/articles/{articles_id}/metafields.json

But the problem is that when I do a search from a mobile device, I keep getting a popup asking for login and password (screenshot).但问题是,当我从移动设备进行搜索时,我不断收到一个弹出窗口,要求输入登录名和密码(屏幕截图)。

在此处输入图像描述

Why does this happen?为什么会这样?

Could it be because of using Admin API?会不会是因为使用了 Admin API? right now the site has a domain like test-site.myshopify.com .现在,该站点的域类似于test-site.myshopify.com

Will this problem be solved if the site has a permanent domain?如果站点有一个永久域,这个问题会得到解决吗?

You CANNOT do Admin API calls from any front-end, mobile, desktop, who cares.您不能从任何前端、移动设备、桌面设备拨打 Admin API 电话,谁在乎呢。 That is a huge security violation as it plasters your secret token all over the inte.net for anyone to pilfer and use.这是一个巨大的安全违规行为,因为它将您的秘密令牌贴在整个互联网上,供任何人窃取和使用。 If you want to make Admin API calls from your store, use App Proxy.如果您想从您的商店拨打管理员 API 电话,请使用 App Proxy。 It is the only way.这是唯一的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM