12 lines
425 B
HTTP
12 lines
425 B
HTTP
// 测试OAuth 2.0密码授权流程
|
|
// 1. 使用密码授权获取访问令牌
|
|
POST http://localhost:5001/api/v1/oauth/token
|
|
Content-Type: application/x-www-form-urlencoded
|
|
|
|
grant_type=password&username=testuser3&password=password123&client_id=futuremail-client&client_secret=futuremail-secret
|
|
|
|
###
|
|
|
|
// 2. 使用访问令牌访问受保护的API
|
|
GET http://localhost:5001/api/v1/mails
|
|
Authorization: Bearer YOUR_ACCESS_TOKEN |