Magento 2 凭据#
¥Magento 2 credentials
你可以使用以下凭据验证以下节点:
¥You can use these credentials to authenticate the following node:
先决条件#
¥Prerequisites
- 创建 Magento(Adobe Commerce) 账户。
¥Create a Magento (Adobe Commerce) account.
- 设置你的存储是否允许将 OAuth 访问令牌用作独立的 Bearer 令牌。
¥Set your store to Allow OAuth Access Tokens to be used as standalone Bearer tokens.
-
前往“管理”>“商店”>“配置”>“服务”>“OAuth”>“使用者设置”。
¥Go to Admin > Stores > Configuration > Services > OAuth > Consumer Settings.
-
将“允许将 OAuth 访问令牌用作独立 Bearer 令牌”选项设置为“是”。
¥Set the Allow OAuth Access Tokens to be used as standalone Bearer tokens option to Yes.
-
你还可以通过运行以下命令从 CLI 启用此设置:
¥You can also enable this setting from the CLI by running the following command:
1bin/magento config:set oauth/consumer/enable_integration_as_bearer 1
在 n8n 更新 Magento 2 凭据以使用 OAuth 之前,此步骤是必需的。有关更多信息,请参阅 集成令牌。
¥This step is necessary until n8n updates the Magento 2 credentials to use OAuth. Refer to Integration Tokens for more information.
支持的身份验证方法#
¥Supported authentication methods
- API 访问令牌
¥API access token
相关资源#
¥Related resources
有关服务的更多信息,请参阅 Magento API 文档。
¥Refer to Magento's API documentation for more information about the service.
使用 API 访问令牌#
¥Using API access token
要配置此凭据,你需要:
¥To configure this credential, you'll need:
- 主机名:输入你的 Magento 商店地址。
¥A Host: Enter the address of your Magento store.
- 访问令牌:从 管理面板 获取访问令牌:
¥An Access Token: Get an access token from the Admin Panel: 1. 前往“系统”>“扩展”>“集成”。
1 | |
-
添加新的集成
¥Add a new Integration. 3. 前往 API 标签页,选择你希望 n8n 集成访问的 Magento 资源。
¥Go to the API tab and select the Magento resources you'd like the n8n integration to access. 4. 在“集成”页面中,激活新集成。
¥From the Integrations page, Activate the new integration. 5. 选择“允许”以显示你的访问令牌,以便你可以复制并将其输入到 n8n 中。
¥Select Allow to display your access token so you can copy it and enter it in n8n.