forked from IoT-Technology/IoT-Technical-Guide
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
28e199f
commit c880e6e
Showing
5 changed files
with
25 additions
and
7 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
...ization Server/src/test/java/iot/technology/oauth2/authorization/OAuth2Authorization.http
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
### 使用密码模式进行授权 | ||
POST http://localhost:8080/oauth/token | ||
Authorization: Basic clientapp 123456 | ||
Content-Type: application/x-www-form-urlencoded | ||
|
||
grant_type=password&username=iot&password=1024 | ||
|
||
### 校验访问令牌的有效性 | ||
POST http://localhost:8080/oauth/check_token | ||
Authorization: Basic clientapp 123456 | ||
Content-Type: application/x-www-form-urlencoded | ||
|
||
token=67480870-0ddc-43a8-9a4e-2cbc657bf6f5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
IOT-Guide-OAuth2.0-Resource/src/test/java/iot/technology/oauth2/resource/OAuth2Resource.http
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
### 使用用户的用户名和密码进行登录 | ||
POST localhost:9090/login | ||
Content-Type: application/x-www-form-urlencoded | ||
|
||
password=1024&username=iot | ||
|
||
### 带访问令牌,则请求会被通过 | ||
GET localhost:9090/api/example/hello | ||
Authorization: Bearer 6411631e-ed0d-46ab-a37c-d63b676f9169 |