> For the complete documentation index, see [llms.txt](https://jen-hsuan-hsieh.gitbook.io/asp-net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jen-hsuan-hsieh.gitbook.io/asp-net/chapter1/1.1.the-complete-asp.net-mvc-5-course/112approved-collection-server/1122qu-de-token-de-fang-shi.md).

# 1.12.3.取得Token的方式

## 1.Introduction

* 取得審批資料, Log資料前必須先向server取得JWT token, 並附在request中驗證身分

## 2.透過Postman

* 1.下載並開啟[Postman](https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop/related?hl=zh-TW)
* 2.選擇方法為POST, 並填入正確的URL
* 3.在Body -> x-www-form-urlencoded
  * 填入兩個key: UserName, Password
  * Value

    則分別複製[UserName, Password的值 (此為private repo, 需先登入Github)](https://github.com/JenHsuan/Approved-Collection-Server/blob/master/DataCollectService/4.Documents/%E5%B8%B3%E8%99%9F%E5%AF%86%E7%A2%BC.com)
* 4.按下Send, 則可取得一個token
* 5.請注意: token的有效期限為20分鐘

![](/files/-M4M0WNWo2Ibhsab1jro)

## 3.透過API

* 請參考: <https://dotblogs.com.tw/wellwind/2016/11/24/jwt-auth-web-api>
