
- Postman 教程
- Postman - 起始頁
- Postman - 簡介
- Postman - 環境設定
- Postman - 環境變數
- Postman - 授權
- Postman - 工作流
- Postman - GET 請求
- Postman - POST 請求
- Postman - PUT 請求
- Postman - DELETE 請求
- Postman - 為 CRUD 建立測試
- Postman - 建立集合
- Postman - 引數化請求
- Postman - 集合執行器
- Postman - 斷言
- Postman - 模擬伺服器
- Postman - Cookie
- Postman - 會話
- Postman - Newman 概覽
- Postman - 使用 Newman 執行集合
- Postman - OAuth 2.0 授權
- Postman 有用資源
- Postman - 快速指南
- Postman - 有用資源
- Postman - 討論
Postman - OAuth 2.0 授權
OAuth 2.0 是 Postman 中的一個授權技術。在這裡,我們首先獲取一個用於訪問 API 的令牌,然後利用該令牌對請求進行身份驗證。令牌用於確保使用者有權訪問伺服器中的資源。
如果我們嘗試在沒有令牌的情況下訪問安全的 URL,將獲得響應程式碼401 未授權。首先,應用程式會傳遞一個授權請求,以便終端使用者訪問資源。
由於應用程式允許使用者訪問,它會透過提供使用者資訊來請求伺服器提供訪問令牌。反過來,伺服器會產生一個訪問令牌。然後,客戶端可以透過訪問令牌訪問安全資料。
廣告