rest - 如何保护我的自定义 Magento2 REST api

标签 rest security magento2

我在 Magento2 中创建了一个自定义的 REST api。但是,如何使用内置的 Magento2 REST api 安全性来保护它?

就像/index.php/rest/V1/customers/me 用 Authorization header 保护

最佳答案

中创建自定义 api 配置时webapi.xml ref="self"
如果您这样配置,您可以使用仅由 magento 2 提供的身份验证访问 API,例如 oauth,token,oauth2

在 magento 的管理面板中禁止匿名访问 api

关于rest - 如何保护我的自定义 Magento2 REST api,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39264914/

相关文章:

rest - 我想使用 azure storage api 列出容器内的所有子文件夹

javascript - 如何防止网页检测到我正在运行脚本?

magento2 - 将售完的产品推至结果末尾

ios - 使用 JIRA API 接收项目列表

web-services - 分层 RESTful URL 设计

mysql - 其余API : Inserting value to MySQL database with ExpressJS

java - SerializationProxy 的字节流攻击 : is it safer?

mysql - 绑定(bind)地址和MySQL服务器

gruntjs - git 咕噜 : Plugin for the “clean” task not found

javascript - Magento2 部署 CSS/JS