Magento 支持三種不同類型的授權方式:
> - **Session**-**based authentication: 比較適合 JavaScript 中的 **widget。Magento 使用管理員或者用戶的登陸狀態來判斷他們的身份并授權訪問相應的資源。
> - **Token**-**based authentication**: 比較適合移動應用或者其他想要避免基于 OAuth 授權的復雜性的應用。要以 REST 的方式獲取 token, 可以通過調用 `POST /V1/integration/customer/token` 或者 `POST /V1/integration/admin/token` 接口。調用成功會返回一個隨機的 32 位長度的字符串,類似 `8pcvbwrp97l5m1pvcdnis6e3930n4rsj` ,這就是后續請求 API 接口需要用到的 token, 通過在請求頭信息中以 `Authorization: Bearer <token>` 這種格式傳遞。
> - **OAuth**-**based authentication:適合第三方應用以用戶的身份集成 Magento 中,不需要暴露用戶 ID 和密碼。Magento 管理員創建基于 **OAuth 授權的第一步是創建一個 integration (位于 **`System | Extensions | Integration | Add New Integration`** ) ,這里我們可以設置 **`Callback URL`** 和 **`Identity link URL`** 之類的選項。這些定義了接收 OAuth 憑證的外部應用。同時這些值指向作為 OAuth 客戶端的應用。保存成功以后,對應的集成會自動創建 OAuth 需要的關鍵憑證,比如 Consumer Key、Consumer Secret 、Access Token 和 Access Token Secret。
<br />采用 OAuth 的授權方式超出了本教程范圍,我們接下來的例子都會采用基于 token 的授權方式。<br />
- Magento 基本概念
- Magento 中的 Plugin
- Magento 中的 Events 和 observers
- Magento 中的 Areas
- Magento 中的請求處理流程
- Magento 中的模塊(Modules)
- Magento 中的 Cache
- Magento 中的依賴注入
- Magento 中的 Console commands
- Magento 中的 Cron jobs
- 掌握 Entities
- 理解 model 的類型
- 理解 setup scripts
- 實體擴展
- 初入 web API
- users 的幾種不同類型
- 授權的不同類型
- APIs 的不同類型
- 使用 Magento 現有的 API
- 創建自定義 web APIs
- 理解 search criteria
- Magento 后臺開發
- 使用 listing 組件
- 使用 form 組件
- 開發前臺功能
- 搭建前臺開發環境
- 初始化 & 調用 JS 組件
- 開始使用 RequireJS
- 替換 jQuery widget 組件
- 擴展 jQuery widget 組件
- 創建 jQuery widgets 組件
- 創建 UI/KnockoutJS 組件
- 擴展 UI/KnockoutJS 組件
- 自定義 Catalog
- 創建參考尺寸
- 創建當天發貨
- 標識新產品
- Magento 性能最佳實踐
- Magento 硬件推薦配置
- 軟件推薦
- 架構參考
- 配置項最佳實踐
- 高級設置
- 其他
- 如何通過 Burp Suite 和 Xdebug 來調試 Magento
- Mageno checkout 必知必會
- Magento 安裝(新手必看)
- 安裝流程
- 系統要求