1
0
mirror of synced 2026-02-22 12:37:49 +08:00

📝 更新文档

This commit is contained in:
yadong.zhang
2020-06-29 00:44:04 +08:00
parent ddde4ef1f5
commit 6ea1d41211
11 changed files with 201 additions and 15 deletions

View File

@@ -23,6 +23,8 @@ https://github.com/。如果已有则忽略该步骤,直接进入第二步。
copy以下三个信息`Client ID``Client Secret``Authorization callback URL`
**重要提示:“应用密钥”可保护你应用程序的安全,因此请确保其不会泄露!也不要与任何人共享你的“应用密钥”!!!**
## 2. 集成JustAuth
@@ -142,4 +144,23 @@ public class RestAuthController {
}
}
}
```
```
## 4. 推荐
官方推荐使用 [JustAuth-demo](https://github.com/justauth/JustAuth-demo) 示例项目进行测试。
使用步骤:
1. clone [https://github.com/justauth/JustAuth-demo.git](https://github.com/justauth/JustAuth-demo.git)
2. 将上面申请的应用信息填入到`RestAuthController#getAuthRequest`方法的对应位置中:
![](doc/media/oauth/e1a40945.png)
3. 启动项目,访问 [http://localhost:8443](http://localhost:8443)
4. 选择对应的平台进行授权登录
![](doc/media/oauth/da2bc692.png)
5. 登录完成后,可以访问[http://localhost:8443/users](http://localhost:8443/users)查看已授权的用户
![](doc/media/oauth/dbe6bcae.png)
注:
1. 如果直接使用 JustAuth-demo 项目进行测试,那么在配置测试应用的“回调地址”时要严格按照以下格式配置:`http://localhost:8443/oauth/callback/{平台名}`
2. 平台名参考 `JustAuthPlatformInfo` 枚举类 `names`