mirror of
https://gitee.com/dromara/sa-token.git
synced 2025-10-22 03:27:23 +08:00
docs: 补全 1.40.0 版本更新文档
This commit is contained in:
@@ -36,6 +36,19 @@ SaOAuth2Util.isGrantScope(loginId, clientId, scopes);
|
||||
```
|
||||
|
||||
|
||||
### Code 相关
|
||||
``` java
|
||||
// 获取 CodeModel,无效的 code 会返回 null
|
||||
SaOAuth2Util.getCode(code);
|
||||
|
||||
// 校验 Code,成功返回 CodeModel,失败则抛出异常
|
||||
SaOAuth2Util.checkCode(code);
|
||||
|
||||
// 获取 Code,根据索引: clientId、loginId
|
||||
SaOAuth2Util.getCodeValue(clientId, loginId);
|
||||
```
|
||||
|
||||
|
||||
### Access-Token 相关
|
||||
``` java
|
||||
// 获取 AccessTokenModel,无效的 AccessToken 会返回 null
|
||||
|
@@ -1,5 +1,8 @@
|
||||
# OpenId 与 UnionId
|
||||
|
||||
<p><a class="case-btn case-btn-video" href="https://www.bilibili.com/video/BV1oz6AY5ERJ/" target="_blank">
|
||||
参考视频:OAuth2 授权流程中的 clientId、openId、unionId、userId 都是干嘛的?
|
||||
</a></p>
|
||||
|
||||
|
||||
### 1、OpenId
|
||||
@@ -186,5 +189,3 @@ unionid 算法要求与 openid 基本一致,可参考上述 openid 算法要
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -257,7 +257,7 @@ http://sa-oauth-server.com:8000/oauth2/token?grant_type=authorization_code&clien
|
||||
测试完毕
|
||||
|
||||
|
||||
### 5、运行官方示例
|
||||
### 5、运行官方示例
|
||||
以上代码只是简单模拟了一下OAuth2.0的授权流程,现在,我们运行一下官方示例,里面有制作好的UI界面
|
||||
|
||||
- OAuth2-Server端: `/sa-token-demo/sa-token-demo-oauth2/sa-token-demo-oauth2-server/` [源码链接](https://gitee.com/dromara/sa-token/tree/master/sa-token-demo/sa-token-demo-oauth2/sa-token-demo-oauth2-server) <br/>
|
||||
@@ -270,3 +270,19 @@ http://sa-oauth-server.com:8000/oauth2/token?grant_type=authorization_code&clien
|
||||
如图,可以针对OAuth2.0四种模式进行详细测试
|
||||
|
||||
|
||||
|
||||
### 6、OAuth2 前端测试页
|
||||
|
||||
OAuth2 前端测试页:
|
||||
`/sa-token-demo/sa-token-demo-oauth2/sa-token-demo-oauth2-client-h5/`
|
||||
[源码链接](https://gitee.com/dromara/sa-token/tree/master/sa-token-demo/sa-token-demo-oauth2/sa-token-demo-oauth2-client-h5) <br/>
|
||||
|
||||
此示例允许你在前端自由配置 OAuth-Client 端所需的各个参数,方便对 OAuth2 四种模式的测试。
|
||||
|
||||

|
||||
|
||||
<p><a class="case-btn case-btn-video" href="https://www.bilibili.com/video/BV13LSMYzEmE/" target="_blank">
|
||||
参考视频:OAuth2 四种模式 前端测试页
|
||||
</a></p>
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user